Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: new custom post to profile and group activity stream.

@sk_tamilan

Participant

hi @shanebp I just tried that and its not working

function rewards_activity_content($activity){

    global $post;

    if ($post->post_type == 'rewards') {

        $activity_id = (int) $activity->id;
        $post_id = (int) $activity->secondary_item_id;
        $user_id = (int) $activity->user_id;
      
        $post_type = get_post_type( $post_id );
        $thumbnail = get_the_post_thumbnail($post_id);
        $post_permalink = get_permalink($post_id);

        
        $activity_content  = "<div class='post-id'>The post ID : {$post_id}</div>\n";
        $activity_content = "<div class='thumbnail'>{$thumbnail}</div>\n";
        $activity->content = $activity_content;
        $activity->action = sprintf(__('%1$s posted a new reward: %2$s', 'buddypress'), bp_core_get_userlink((int) $post->post_author), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>');

    }
    return $activity;

}
Skip to toolbar