Hooks Reference
BuddyPress Newsfeed overviewPremiumGet BuddyPress Newsfeed →
This page documents every filter that BuddyPress Newsfeed owns (calls apply_filters on), and summarises the key BuddyPress hooks the plugin attaches to. Use this page when you need to extend or modify plugin behaviour without editing plugin files.
Plugin-owned filters
Section titled “Plugin-owned filters”bnews_add_activity_lists_to_filter
Section titled “bnews_add_activity_lists_to_filter”Filters the array of activity scopes that are merged into the Newsfeed stream.
Location: public/class-buddypress-newsfeed-public.php, inside bnews_alter_activities_parse_args(). It runs only when the Newsfeed tab is being shown, and the array keys become the BuddyPress activity scope.
Signature:
apply_filters( 'bnews_add_activity_lists_to_filter', array $act_list )Parameter:
| Name | Type | Description |
|---|---|---|
$act_list |
array |
Associative array of slug => label pairs. Keys are the BuddyPress activity scope slugs. |
Default value of $act_list before the filter fires:
array( 'just-me' => __( 'Personal', 'buddypress-newsfeed' ), 'mentions' => __( 'Mentions', 'buddypress-newsfeed' ), 'favorites' => __( 'Favorites', 'buddypress-newsfeed' ), 'friends' => __( 'Friends', 'buddypress-newsfeed' ), 'groups' => __( 'Groups', 'buddypress-newsfeed' ), 'following' => __( 'Following', 'buddypress-newsfeed' ),)BuddyPress skips a scope whose component is not active, so friends, groups and following are harmless when those features are off. A custom scope needs its own bp_activity_set_{scope}_scope_args filter, or BuddyPress ignores it.
Example - add a custom scope to the merged feed:
add_filter( 'bnews_add_activity_lists_to_filter', function( $act_list ) { $act_list['bookmarks'] = __( 'Bookmarks', 'my-plugin' ); return $act_list;} );Example - remove a scope (e.g. Favorites) from the merged feed:
add_filter( 'bnews_add_activity_lists_to_filter', function( $act_list ) { unset( $act_list['favorites'] ); return $act_list;} );BuddyPress hooks the plugin attaches to
Section titled “BuddyPress hooks the plugin attaches to”These are the BuddyPress and WordPress hooks the plugin registers callbacks on. They are listed here as a reference for debugging and for developers who need to un-hook plugin behaviour. Registration lives in define_public_hooks() in includes/class-buddypress-newsfeed.php. None of them are registered when the BuddyPress Activity Streams component is off.
| Hook | Type | Priority | Callback | What it does |
|---|---|---|---|---|
bp_setup_nav |
action | 999 | bnews_setup_submenu_activity_newsfeed |
Registers the Newsfeed and Personal sub-nav items under the Activity component |
bp_actions |
filter | 10 | bnews_newsfeed_activity_feed |
Removes individual activity sub-nav tabs (favorites, friends, groups, mentions, following) when “Disable for Activity-Specific Tabs” is enabled |
bp_before_has_activities_parse_args |
filter | 10 | bnews_alter_activities_parse_args |
Injects the merged scope list (see bnews_add_activity_lists_to_filter) into the activity query when the Newsfeed tab is active |
bp_after_has_activities_parse_args |
filter | 10 | bpnewsfeed_filter_relevant_activity |
Modifies the activity directory query to show only content relevant to the logged-in user. Visitors who are not logged in keep the full directory (registered on non-BuddyBoss installs only) |
bp_activity_set_bnews-forums_scope_args |
filter | 10 | bnews_forums_activity_scope |
Adds topics and replies from the member’s subscribed bbPress forums and topics to Relevant Activity (non-BuddyBoss installs only) |
admin_bar_menu |
action | 10 | bnews_update_wp_menus |
Replaces the default “Personal” admin bar activity link with plugin-managed Newsfeed and Personal links |
admin_bar_menu |
action | 99 | bnews_admin_bar_menu |
Removes individual activity scope links from the admin bar toolbar when merging is enabled |
bp_before_member_activity_post_form |
action | 10 | bnews_post_form |
Renders the activity post form on the Newsfeed tab when the post form option is enabled |
bp_activity_single_at_mentions_notification |
filter | 10 | bnews_change_mention_notification_link_on_merge |
When the Mentions tab is hidden, points a single mention at the activity post |
bp_activity_multiple_at_mentions_notification |
filter | 10 | bnews_change_mention_notification_link_on_merge |
When the Mentions tab is hidden, points several mentions at the member’s Newsfeed tab |
wp_enqueue_scripts |
action | 10 | enqueue_styles |
Loads the plugin stylesheet on community pages. On BuddyBoss, on the member’s own Newsfeed, it hides BuddyBoss’s post form when the post form option is off, or (with BuddyBoss activity filter tabs on) attaches a short script to BuddyBoss’s bp-nouveau script that keeps the form visible |
The two Relevant Activity bindings are registered on standard BuddyPress installs only, not on BuddyBoss Platform.
Disabling plugin behaviour
Section titled “Disabling plugin behaviour”The simplest, supported way to turn off the directory-level relevant feed is to set Enable Relevant Activity to off in the admin settings, rather than unhooking at the PHP level. Because the plugin registers its callbacks as instance methods through a loader, you would need the live Buddypress_Newsfeed_Public instance to call remove_filter(), which the plugin does not expose.
Date display
Section titled “Date display”Dates the plugin shows (the licence expiry date) go through bnews_date_label(), in the timezone from bnews_display_timezone().
bnews_display_timezone
Section titled “bnews_display_timezone”Filters the timezone every date in the plugin is shown in. Default: the site timezone (wp_timezone()).
apply_filters( 'bnews_display_timezone', DateTimeZone $timezone, int $user_id )
