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:

functions.php
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.

  1. BuddyPress icon BuddyPress90,000+ installs apply_filters_ref_array( 'bp_get_activity_content_body', array( $activity->content, &$activity ) ) bp-activity/bp-activity-functions.php:3882
  2. BP Classic icon BP Classic6,000+ installs apply_filters( 'bp_get_activity_content_body', $activity->content ) themes/bp-default/_inc/ajax.php:574
  3. Wbcom Designs icon Wbcom Designs300+ installs apply_filters_ref_array( 'bp_get_activity_content_body', array( $content, &$activity ) ) includes/class-share-context.php:98
  4. WPGraphQL BuddyPress icon WPGraphQL BuddyPress10+ installs apply_filters( 'bp_get_activity_content_body', $activity->content, $activity ) src/Type/ObjectType/ActivityType.php:209
  5. MIF BP Customizer icon 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.