Skip to content

The plugin creates three tables on activation. All table names use the WordPress table prefix (default wp_).

Stores the available emoji library.

Column Type Description
id int AUTO_INCREMENT Primary key
name varchar(500) Display label (editable in the Manage Emojis tab)
type enum('inbuilt','custom') Whether the emoji is built-in or user-created
format varchar(10) File format, stored as svg/json for built-in emojis

On activation the plugin populates this table with 204 built-in emojis. SVG files are stored in the plugin’s emojis/svg/ directory and referenced by ID.

Stores named reaction set configurations.

Column Type Description
id bigint AUTO_INCREMENT Primary key
name varchar(255) Human-readable name (e.g. “Activity Reaction”)
post_type varchar(255) Associated content type
front_render boolean 1 if this set is rendered on the front end
options text JSON object of configuration options

Since 2.5.3 the emojis, animation and alignment a content type shows are read from the bp_reactions_settings option, not from the options JSON. The Reactions tab still copies a saved emoji list into the matching row because the Reign and BuddyX Pro blog comment pickers read it there.

A fresh install creates these sets:

ID Name post_type
1 Posts Reaction post
2 Activity Reaction empty
3 Activity Comment Reaction empty
4 bbPress Topic Reactions topic
5 bbPress Reply Reactions reply

Records each individual reaction by a member.

Column Type Description
id bigint AUTO_INCREMENT Primary key
post_id bigint ID of the content item that was reacted to
post_type varchar(50) Content type (e.g. activity, activity-comment, post, bbp_topic, bbp_reply)
reacted_to varchar(10) Reaction target marker recorded with each reaction (shown in the admin Reactions Log)
user_id bigint WordPress user ID of the member who reacted
emoji_id int FK to bp_reactions_emojis.id
bprs_id bigint Reaction set number. It is not the same for every place a reaction is shown (see below).
reacted_date datetime Timestamp of the reaction (used for the Reactions board and Insights periods)

A unique key on user_id, post_id and post_type allows one row per member per item. When a member changes their reaction, the row is updated in place (emoji_id is overwritten). When they remove it, the row is deleted. Updating to 2.5.3 removes older duplicate rows and keeps each member’s newest.

Other indexes cover user_id with post_id, post_id with post_type, emoji_id, reacted_date and post_type with reacted_date.

bprs_id is not the same for every place a reaction is shown. Activity reactions carry 1, activity comments 2, forum topics 3 and forum replies 4. Blog posts and the [bp_reactions] shortcode carry the set’s own ID. Query by post_id and post_type, not by bprs_id.

global $wpdb;
// Total reactions on one activity post
$count = $wpdb->get_var( $wpdb->prepare(
"SELECT COUNT(*) FROM {$wpdb->prefix}bp_reactions_reacted_emoji
WHERE post_id = %d AND post_type = %s",
$activity_id,
'activity'
) );

If Delete all data on uninstall is on in the General tab when you delete the plugin, the uninstall routine drops all three tables, deletes the plugin options and transients, and deletes the “reacted to your post” notifications. On multisite it does this for every site. This is irreversible. With the switch off, nothing is removed.

  • Hooks and Filters - bp_reactions_after_react fires after each row is inserted or updated
  • Reactions Log - admin UI for browsing bp_reactions_reacted_emoji