API Reference
BuddyPress Moderation Pro provides a comprehensive API for developers to interact with the moderation system programmatically.
Core Functions
bmpro_flag_content()
Flag content programmatically.
bmpro_flag_content( array(
'content_id' => 123,
'content_type' => 'activity',
'user_id' => get_current_user_id(),
'reason' => 'spam',
'description' => 'Optional additional details'
) );
bmpro_unflag_content()
Remove a flag from content.
bmpro_unflag_content( $content_id, $content_type, $user_id );
bmpro_is_content_flagged()
Check if content is flagged.
$is_flagged = bmpro_is_content_flagged( $content_id, $content_type );
// Returns: true/false
bmpro_get_flag_count()
Get the number of flags on content.
$count = bmpro_get_flag_count( $content_id, $content_type );
// Returns: integer
User Functions
bmpro_block_user()
bmpro_block_user( $blocker_id, $blocked_id );
bmpro_unblock_user()
bmpro_unblock_user( $blocker_id, $blocked_id );
bmpro_is_user_blocked()
$is_blocked = bmpro_is_user_blocked( $user_id, $by_user_id );
// Returns: true/false
Content Types
Valid content type identifiers:
activity– Activity postsactivity_comment– Activity commentsmember– Member profilesgroup– BuddyPress groupsmessage– Private messagesforum_topic– bbPress topicsforum_reply– bbPress replies
