Skip to:
Content
Pages
Categories
Search
Top
Bottom

Include post categories in activity items


  • JetZ
    Participant

    @yetza

    I would like to include the post category with the author name and post title. I have looked all over and found a bunch of answers along these lines

    $activity_action = sprintf( __( '%1$s added the post, %2$s in the categories %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', get_the_category_list( ', ', '', $post->ID ) );

    I have tried using the various functions available for getting the categories but no luck. Worth noting is that the current Buddypress version is using $action instead of $activity_action and the rest of the arguments have been modified also.

    I tried adding

    add_filter('wp_get_post_categories()', 'bp_blogs_activity_new_post_action');

    into my theme’s functions.php file but nothing.

    What am I missing?

    Thanks in advance.

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