Reply To: Custom activity new post content NOT broken after update the post
Hi @shanebp,
I can solve the problem!
This is the code thats work perfect:
add_filter( 'bp_blogs_record_activity_content', 'record_post_activity_content_update');
function record_post_activity_content_update( $excerpt, $post_content, $activity ) {
global $post;
if( $post->post_type == 'post' ) {
$post_content= '<a href="' . get_permalink( $post->ID ) . '" class="activity-content-title" >'
. get_the_post_thumbnail( $post->ID, 'articulo-lateral')
. get_post_field('post_title', $post->ID) . '</a>'
.get_post_field('post_content', $post->ID);
}
return $post_content;
}
Example:
1- New post activity: https://i.imgur.com/75Qf5WH.png
2- Edited post activity: https://i.imgur.com/0dWME4m.png
The only problem that I find is not caused by this: Activity comments closed for the edited posts: https://buddypress.org/support/topic/activity-comments-closed-for-the-edited-posts/
Thanks and best regards,
Gabriel