WordPress filter hook
bp_get_activity_content_body
Fired by 5 WordPress plugins, running on 96K+ sites between them.
“This filter is documented in bp-activity/bp-activity-template.php”
How to use bp_get_activity_content_body
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'bp_get_activity_content_body', function( $content, $activity ) {
// Change $content here.
return $content;
}, 10, 2 );Argument names come from BuddyPress's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
5 plugins that fire bp_get_activity_content_body
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
BuddyPress90,000+ installs
apply_filters_ref_array( 'bp_get_activity_content_body', array( $activity->content, &$activity ) )bp-activity/bp-activity-functions.php:3882 -
BP Classic6,000+ installs
apply_filters( 'bp_get_activity_content_body', $activity->content )themes/bp-default/_inc/ajax.php:574 -
Wbcom Designs300+ installs
apply_filters_ref_array( 'bp_get_activity_content_body', array( $content, &$activity ) )includes/class-share-context.php:98 -
WPGraphQL BuddyPress10+ installs
apply_filters( 'bp_get_activity_content_body', $activity->content, $activity )src/Type/ObjectType/ActivityType.php:209 -
MIF BP Customizer10+ installs
apply_filters_ref_array( 'bp_get_activity_content_body', array( $reposted_activity->content, &$reposted_activity ) )inc/repost-button-template.php:119
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.