Hooks and Filters
Hooks and Filters
Section titled “Hooks and Filters”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 );Parameters:
| 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 use: award points when a member’s content receives a reaction.
add_action( 'bp_reactions_after_react', function( $user_id, $post_id, $post_type, $emoji_id, $is_change ) { if ( ! $is_change ) { // New reaction — do something with $post_id author }}, 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 );Parameters:
| 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 emoji picker for any content type.
apply_filters( 'buddypress_reactions_max_emojis', $max );Parameters:
| Parameter | Type | Description |
|---|---|---|
$max |
int |
Default: 8 |
Example: allow up to 12 reactions.
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. Lets you override a template with a custom file.
apply_filters( 'bp_reactions_emoji_layout', $file_path, $name );Parameters:
| 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 );Parameters:
| Parameter | Type | Description |
|---|---|---|
$should_load |
bool |
Whether to enqueue styles |
Example: prevent styles from loading on a specific page type.
add_filter( 'buddypress_reactions_load_styles', function( $should_load ) { if ( is_single() ) { return false; } return $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 slugs that are treated as supported. Add your theme’s template slug to bypass the “unsupported theme” admin notice.
apply_filters( 'buddyPress_reactions_theme_suuport', $themes );Note: the filter name contains a typo (suuport) — match it exactly in your code.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$themes |
array |
Default: ['reign-theme', 'buddyx-pro'] |
Example: add support for a custom theme.
add_filter( 'buddyPress_reactions_theme_suuport', function( $themes ) { $themes[] = 'my-custom-theme'; return $themes;} );buddypress_reactions_default_post_types
Section titled “buddypress_reactions_default_post_types”Filters the list of post types that receive default reaction configurations on plugin activation.
apply_filters( 'buddypress_reactions_default_post_types', $post_types );Widget filters
Section titled “Widget filters”The stats widgets expose several filters for fine-grained control. These follow the standard widget_* filter convention used by WordPress.
| Filter | Default | Description |
|---|---|---|
widget_title |
Widget title setting | Standard WordPress widget title filter |
widget_reaction_statistic |
'forever' |
Time period for the Reactions List widget |
widget_reactions_shortcodes |
Array of shortcode IDs | Which reaction set IDs the widget queries |
widget_max_reactions |
8 |
Max items shown in the Reactions List widget |

