Skip to content

The plugin exposes the following action hooks and filters for developers.

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 );

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

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;
} );

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)

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;
} );

Controls whether the plugin’s front-end JavaScript is enqueued. Same signature as buddypress_reactions_load_styles.


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.


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]

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

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.