Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: new blog post in site wide activity stream but not in personal activity stream

@teruun

Participant

Thanks, @henrywright
So i changed my code to this:

function buddypress_edit_blog_post($post_id) {
     global $bp; //, $user_id;
     $user_id = wp_get_current_user();
     $post = get_post($post_id); 
     $title = $post->post_title;
     $user_fullname  = bp_core_get_user_displayname($user_id);

     bp_activity_add(array(
    'action' => $user_fullname.' updated ' . $title . ':',
    'component' => 'blog_post',
    'type' => 'update_post',
    'primary_link' => get_permalink($post_id),
    'user_id' => $user_id,
    'content' => $post->post_content
     ));

}
add_action('edit_post', 'buddypress_edit_blog_post');

I don’t know is it right to use wp_get_current_user() function. But the personal activity stream still doesn’t have my blog post, and the site wide activity stream still has.

What should I try next?
Thanks.

Skip to toolbar