Skip to content

Instantly share code, notes, and snippets.

@pranali333
Last active November 4, 2015 17:15
Show Gist options
  • Save pranali333/e3aa4901f79814bb26fc to your computer and use it in GitHub Desktop.
Save pranali333/e3aa4901f79814bb26fc to your computer and use it in GitHub Desktop.
Usage of filter : bp_activity_new_update_content
// Use this filter in your theme's functions.php file if you want to filter the content of new activity.
// For example below code will append username to current activity item.
// define the bp_activity_new_update_content callback
function filter_bp_activity_new_update_content( $activity_content )
{
// Append additional content here...
$user_info = get_userdata(get_current_user_id());
$activity_content = 'I am user : '.$user_info->user_login." ".$activity_content;
// remove the filter
remove_filter( 'bp_activity_new_update_content', 'filter_bp_activity_new_update_content', 10, 1 );
return $activity_content;
}
// add the filter
add_filter( 'bp_activity_new_update_content', 'filter_bp_activity_new_update_content', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment