Skip to content

Hooks and Filters

The addon exposes filters and one action for customizing activity content, member gating, and localization. All are used by the addon itself, so their signatures are stable.

Hook Fires Use
wbpbi_peepso_bbpress_integration_loaded After the main class constructor runs Run code once the addon has loaded.

These filters let you add tokens to the admin token reference for each activity type. Return the modified associative array of {token} => label.

  • wbpbi_filter_new_forum_activity_content_parameters
  • wbpbi_filter_new_topic_activity_content_parameters
  • wbpbi_filter_new_reply_activity_content_parameters

These filters receive the final activity string after token replacement, plus the source id and the setting key. Return the modified string.

  • wbpbi_filter_new_forum_activity_message - ( $content, $forum_id, $setting_content )
  • wbpbi_filter_new_topic_activity_message - ( $content, $topic_id, $setting_content )
  • wbpbi_filter_new_reply_activity_message - ( $content, $reply_id, $setting_content )

Override the per-member activity display value

Section titled “Override the per-member activity display value”

Read filters for the member preference default shown in PeepSo preferences:

  • filter_new_forum_activity_setting - ( $value, $user_id )
  • filter_new_topic_activity_setting - ( $value, $user_id ) (also reused for the reply preference field)

Write-time filters that decide whether a given member’s action actually posts an activity:

  • alter_peepso_bbpress_forum_activity_allowed_by_user - ( $value, $meta_key, $author_id )
  • alter_peepso_bbpress_topic_activity_allowed_by_user - ( $value, $meta_key, $author_id )
  • alter_peepso_bbpress_reply_activity_allowed_by_user - ( $value, $meta_key, $author_id )
  • wbpbi_peepso_bbpress_integration_plugin_locale - ( $locale, 'peepso-bbpress' ) filters the locale used when loading the text domain.

PeepSo and bbPress hooks the addon consumes

Section titled “PeepSo and bbPress hooks the addon consumes”

For reference, the addon attaches to these upstream hooks (not defined by the addon):

  • PeepSo: peepso_init, peepso_admin_config_tabs, peepso_navigation_profile, peepso_rewrite_profile_pages, peepso_profile_segment_forums, peepso_profile_preferences, peepso_profile_alerts, peepso_profile_notification_link, peepso_activity_post_content, peepso_group_segment_menu_links, peepso_group_segment_forum, peepso_register_new_user.
  • bbPress: bbp_new_forum_post_extras, bbp_new_topic_post_extras, bbp_new_reply_post_extras, bbp_new_topic_pre_extras, bbp_new_reply_pre_extras, bbp_new_topic_redirect_to, bbp_get_forum_id, bbp_get_template_part, bbp_get_user_profile_url, and the bbPress user-context filters used by the profile tab.

All use the wbpbi_ajax_security nonce and are registered for both logged-in and logged-out users:

wbpbi_add_ajax_load_more_pagination, wbpbi_add_ajax_load_more_pagination_profile, wbpbi_add_ajax_load_more_pagination_profile_replies, wbpbi_add_ajax_load_more_pagination_profile_topic_favorite, wbpbi_add_ajax_load_more_pagination_profile_forum_subscription, wbpbi_add_ajax_load_more_pagination_profile_topic_subscription.

See also Template overrides.