Skip to content

Integration Guide

Common ways to extend BuddyPress Moderation Pro from your own plugin or theme. All of the hooks referenced here are listed in Hooks and filters.

Use the bpmp_*_flagged actions to run custom logic when content is reported, such as logging to an external service or notifying a channel.

add_action( 'bpmp_activity_flagged', function ( $activity_id, $activity_user_id, $reporter_id, $subject, $report_post_id ) {
my_log_report( 'activity', $activity_id, $reporter_id, $subject );
}, 10, 5 );

Gate the flag button with bmpro_user_can_report.

add_filter( 'bmpro_user_can_report', function ( $can ) {
// Only let members older than 7 days report.
$user = wp_get_current_user();
if ( $user->ID && ( time() - strtotime( $user->user_registered ) ) < WEEK_IN_SECONDS ) {
return false;
}
return $can;
} );
add_filter( 'bmpro_auto_mod_limit_filter', function ( $limit, $settings ) {
// Lower the threshold at night.
return ( (int) current_time( 'H' ) >= 22 ) ? 3 : $limit;
}, 10, 2 );
add_filter( 'bmpro_get_flag_unflag_text', fn( $text ) => $text === 'Flag' ? 'Report' : $text );
add_filter( 'buddypress_moderation_theme_suuport', function ( $themes ) {
$themes[] = 'my-theme';
return $themes;
} );

Add options to the per-member or per-group action lists surfaced in the queue.

add_filter( 'bmpro_member_related_actions_filter', function ( $actions ) {
$actions['warn'] = __( 'Send warning', 'my-plugin' );
return $actions;
} );
// Suppress the admin email during a quiet period.
add_filter( 'bmpro_filter_enabled_admin_flag_email', fn( $send ) => my_is_quiet_hours() ? false : $send );
  • Load your integration after BuddyPress Moderation Pro so its hooks are registered.
  • Always return a value from filters, and match the accepted-args count to the signatures in the hooks reference.
  • The plugin exposes no REST routes of its own; if you need moderation data over REST, read it from the BuddyPress activity endpoint, which the plugin augments via bp_rest_activity_prepare_value.