Hooks and Filters
BuddyPress Reactions overviewPremiumGet BuddyPress Reactions →
The plugin exposes the following action hooks and filters for developers.
Action hooks
Section titled “Action hooks”bp_reactions_after_react
Section titled “bp_reactions_after_react”Fires after a member successfully adds or changes a reaction.
do_action( 'bp_reactions_after_react', $user_id, $post_id, $post_type, $emoji_id, $is_change );| Parameter | Type | Description |
|---|---|---|
$user_id |
int |
ID of the member who reacted |
$post_id |
int |
ID of the post or activity item |
$post_type |
string |
Content type: activity, activity-comment, post, topic, reply |
$emoji_id |
int |
ID of the emoji from the reactions emoji table |
$is_change |
bool |
true if the member changed an existing reaction, false for a new one |
Example - do something when a member’s content receives a new reaction:
add_action( 'bp_reactions_after_react', function( $user_id, $post_id, $post_type, $emoji_id, $is_change ) { if ( ! $is_change ) { // New reaction on $post_id }}, 10, 5 );bp_reactions_after_unreact
Section titled “bp_reactions_after_unreact”Fires after a member removes their reaction.
do_action( 'bp_reactions_after_unreact', $user_id, $post_id, $post_type );| Parameter | Type | Description |
|---|---|---|
$user_id |
int |
ID of the member who removed the reaction |
$post_id |
int |
ID of the post or activity item |
$post_type |
string |
Content type |
Filters
Section titled “Filters”buddypress_reactions_max_emojis
Section titled “buddypress_reactions_max_emojis”Controls the maximum number of reaction choices shown in the picker for any content type.
apply_filters( 'buddypress_reactions_max_emojis', $max );| Parameter | Type | Description |
|---|---|---|
$max |
int |
Default: 8 |
add_filter( 'buddypress_reactions_max_emojis', function() { return 12;} );bp_reactions_emoji_layout
Section titled “bp_reactions_emoji_layout”Filters the file path used to render an emoji template, so you can override a template with a custom file.
apply_filters( 'bp_reactions_emoji_layout', $file_path, $name );| Parameter | Type | Description |
|---|---|---|
$file_path |
string |
Absolute path to the default template file |
$name |
string |
Template name (without .php) |
buddypress_reactions_load_styles
Section titled “buddypress_reactions_load_styles”Controls whether the plugin’s front-end CSS is enqueued.
apply_filters( 'buddypress_reactions_load_styles', $should_load );| Parameter | Type | Description |
|---|---|---|
$should_load |
bool |
Whether to enqueue styles |
add_filter( 'buddypress_reactions_load_styles', function( $should_load ) { return is_single() ? false : $should_load;} );buddypress_reactions_load_scripts
Section titled “buddypress_reactions_load_scripts”Controls whether the plugin’s front-end JavaScript is enqueued. Same signature as buddypress_reactions_load_styles.
buddyPress_reactions_theme_suuport
Section titled “buddyPress_reactions_theme_suuport”Filters the list of theme template slugs whose front end loads the reaction assets. Add your theme’s slug to have assets enqueued on it.
apply_filters( 'buddyPress_reactions_theme_suuport', $themes );Note: the hook name contains a typo (suuport, and the mixed-case buddyPress). Match it exactly.
| Parameter | Type | Description |
|---|---|---|
$themes |
array |
Default: ['reign-theme', 'buddyx-pro'] |
add_filter( 'buddyPress_reactions_theme_suuport', function( $themes ) { $themes[] = 'my-custom-theme'; return $themes;} );This filter only governs asset loading. The main plugin file separately hard-checks that the active theme is reign-theme, buddyx-pro, or buddyx, and deactivates otherwise. That activation check is not filterable.
buddypress_reactions_default_post_types
Section titled “buddypress_reactions_default_post_types”Filters the post types that receive a default reaction set on activation.
apply_filters( 'buddypress_reactions_default_post_types', $post_types );| Parameter | Type | Description |
|---|---|---|
$post_types |
array |
Map of post-type slug to post-type object. Default: ['post' => WP_Post_Type] |
Widget filters
Section titled “Widget filters”The stats widgets expose filters that follow the standard widget_* convention.
| Filter | Used by | Description |
|---|---|---|
widget_title |
All three widgets | Standard WordPress widget title filter |
widget_reaction_statistic |
Reactions List widget | Time period for the query |
widget_reactions_shortcodes |
Reactions List widget | Which reaction set IDs the widget queries |
widget_max_reactions |
Reactions List widget | Max items shown |
License filters
Section titled “License filters”The bundled license configuration exposes filters used by the update/license layer: bp_reactions_license_item_id, bp_reactions_license_item_name, bp_reactions_license_store_url, bp_reactions_license_author, and bp_reactions_license_item_slug.

