Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

  • Monkey1980
    Participant

    @monkey1980

    @imath …das ist perfekt!

    Though I tweaked it a little so as to have the correct German wording:

    if ( empty( $matches[1][1] ) || ‘link’ != $matches[1][1] ) {
    return $action;
    }

    —>

    leaving it as Artikel meant that changing the wording (below) resulted in the word ‘Artikel’ not displaying! lol – All good now though – you are wonderful sir! – Thanks for the BuddyPress update and your assistance here, have a great weekend. :0))

    —>

    ‘bp_activity_new_post’ => __( ‘%1$s hat den neuen Artikel link geschrieben’, ‘sozialdynamik’ ),
    ‘bp_activity_new_post_ms’ => __( ‘%1$s hat den neuen Artikel link geschrieben, on the site %3$s’, ‘sozialdynamik’ ),


    Monkey1980
    Participant

    @monkey1980

    Thanks @imath – I really appreciate it …and so will my client!


    @youmin
    – I’m not sure i’m clear on what you ask but:

    ‘contexts’ => array( ‘activity’, ‘member’ ),

    I would assume ‘group’ (…or ‘groups’) would do the job? …i’m sure @imath will confirm bur seems reasonable to me (I don’t use groups so can’t confirm)


    Monkey1980
    Participant

    @monkey1980

    OMG – you are AMAZING!!! – that worked a treat, i’m so happy :0))

    Now, if only it could show the Article Title instead of ‘Artikel’ – that would be brilliant!

    Thanks you so much for your help here.


    Monkey1980
    Participant

    @monkey1980

    1. I just did it to test, the original code you provided was for pages – having established that it worked I then had an entry in the activity, in the admin it showed ‘Published a new page’ – i then changed the post type to my custom one and set my action id and notice in the admin it said ‘Unregistered action – new_blog_page’ in the Action Column for the page test entry – I realised this was the ‘action_id’ from your original code so new the code worked. It just does not work when I set my CPT for some reason. The CPT does create an activity entry but using the default message.

    2. It is registered using Easy Custom Post Types plugin, however I have another CPT in my child theme (services-type.php) and the same thing happens for this post type.

    3. This is possible for the CPT in my child theme but not the one’s created using the ECPT plugin – I will test with this disabled and perhaps migrate the CPT’s into the child theme if I find that it is causing the conflict.


    Monkey1980
    Participant

    @monkey1980

    Sorry!

    Indeed, the New Post generates an activity item with ‘user wrote a new item’ – if a then change the CPT to ‘page’ but leave the action ID as my custom one the WordPress Admin and the Frontend both show my custom activity message! my code is below – the %3$s makes sense as I not running multi-site:

    // Don't forget to add the 'buddypress-activity' support!
    add_post_type_support( 'sd_article', 'buddypress-activity' );
     
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'sd_article', array(
            'component_id'             => buddypress()->activity->id,
            'action_id'                => 'new_sd_article',
            'bp_activity_admin_filter' => __( 'Neuer Artikel veröffentlicht', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Artikel', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'bp_activity_new_post'     => __( '%1$s hat den neuen <a href="%2$s">Artikel</a>', 'sozialdynamik' ),
            'bp_activity_new_post_ms'  => __( '%1$s hat den neuen <a href="%2$s">Artikel</a>, on the site %3$s', 'sozialdynamik' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );
    
    ----->

    I hope this is clearer!! :0)

Viewing 5 replies - 1 through 5 (of 5 total)
Skip to toolbar