Skip to:
Content
Pages
Categories
Search
Top
Bottom

Customize blog post activity feeds

  • @pscolv

    Participant

    Hi,

    I managed to customize my activity feed for a custom post type, however I’m struggling to influence the output of “standard” blog posts !

    Ideally I would like to redirect the “format_callback” parameter to the custom callback I created for my custom post type, which should handle both standard and custom types ultimately.

    I tried the following code, and the format_callback stayed desperately the same for the blog posts…

    add_action( ‘bp_register_activity_actions’, ‘customize_posts_tracking_args’ );
    function customize_posts_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( ‘post’, array(
    ‘component_id’ => buddypress()->blogs->id,
    ‘action_id’ => ‘new_blog_post’,
    ‘format_callback’ => ‘custom_format_activity_action_post’,
    ) );
    }

    Then I also tried the filters, which I found in some web pages, but they didn’t work either for blog post type… The code below didn’t cause any change to my activity feed.

    // Customize post publication activity feed content
    add_filter(‘bp_blogs_record_activity_action’, ‘record_cpt_activity_content’);
    add_filter(‘bp_blogs_record_activity_content’, ‘record_cpt_activity_content’);
    function record_cpt_activity_content( $cpt ) {
    echo “Any text”;
    $cpt=’Any text’;
    $cpt[‘content’]=’Any text’;
    return $cpt;
    }

    Any help is very welcome here !!!

    Regards,

    Pascal.

Viewing 1 replies (of 1 total)
  • @ripulkr

    Participant

    Hi, interesting request. It would be really great if you can also specify what kind of changes are you trying to make to the output of the activity feed.

    A common mistake in such cases : Please check that your execution of add_action(‘bp_register_activity_actions’ … is before the action has been executed.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar