Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress Custom Post Type in Activity Stream


  • ashikai
    Participant

    @ashikai

    I’ve been attempting to customize the feed item generated for my custom post type on my buddypress/multisite installation. I’m really just trying to change the default text.

    I’ve found what SHOULD be the correct code and I’ve set it up for my site, but… the changes never take. I’m not caching anything so that’s one potential complication excluded.

    This is my current code (placed in bp_custom.php in my /plugins folder) :

    add_post_type_support( 'webcomic', 'buddypress-activity' );
    
    function customize_webcomic_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( 'webcomic', array(
            'component_id'             => buddypress()->blogs->id,
            'action_id'                => 'new_webcomic_update',
            'bp_activity_admin_filter' => __( 'Updated the Comic', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Webcomic', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">comic page</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">comic page</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_webcomic_tracking_args' );

    So the custom post type “webcomic” is generated via a plugin (called Webcomic), it’s not something I’m registering in my functions.php file. I’ve tried every “fix” I can find, and none of the changes can make this code stick! (this includes changing bp_init to just init).

    I’m running buddypress 2.6. I would really appreciate it if someone could help me troubleshoot this. Even just confirming that the above code is correct would be a big help!

    Thank you very much!

  • You must be logged in to reply to this topic.
Skip to toolbar