Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Custom activity new post content NOT broken after update the post

@shanebp

Moderator

I’m not sure exactly what your issue is, but your function accepts only one parameter.
But 3 are passed.
Yours:
function record_post_activity_content_update($content){

The filter_hook:
$activity->content = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $post_content ), $post_content, (array) $activity );

Notice that post_id is not in there.
It might be in $activity.

So try something like this:

function record_post_activity_content_update( $excerpt, $post_content, $activity ) {
   $post_id = $activity->secondary_item_id;
   // or
   $post_id = $activity->item_id;
   // then build your string using $post_id rather than $post->ID
Skip to toolbar