Developer Hooks Reference

Get Started

Customize Member Blog behavior using WordPress actions and filters. This guide covers all public hooks available for developers.


Filters

Blog Component

bp_member_change_blog_slug

Change the URL slug for the blog component in member profiles.

add_filter( 'bp_member_change_blog_slug', function( $slug ) {
    return 'my-articles'; // Changes /members/username/blog/ to /members/username/my-articles/
});

Default: blog


bp_member_change_blog_label

Change the label displayed for the blog tab in member profiles.

add_filter( 'bp_member_change_blog_label', function( $label ) {
    return 'My Articles';
});

Default: Blog


Content & Media

bpmb_allowed_image_mime_types

Control which image types members can upload for featured images.

add_filter( 'bpmb_allowed_image_mime_types', function( $types ) {
    return array(
        'image/jpeg',
        'image/png',
        // Removed: image/gif, image/webp
    );
});

Default: image/jpegimage/pngimage/gifimage/webp


bpmb_max_upload_size

Override the maximum upload size for featured images (in MB).

add_filter( 'bpmb_max_upload_size', function( $size ) {
    return 5; // 5 MB limit
});

Default: Uses admin setting or 2 MB


bp_member_blog_post_data

Filter post data before saving to the database.

add_filter( 'bp_member_blog_post_data', function( $post_data ) {
    // Add a prefix to all post titles
    $post_data['post_title'] = '[Member] ' . $post_data['post_title'];
    return $post_data;
});

Parameters:

  • $post_data (array) – Post data array with title, content, status, etc.

Dashboard & Display

bp_member_blog_posts_per_page

Change the number of posts shown per page in the dashboard.

add_filter( 'bp_member_blog_posts_per_page', function( $per_page ) {
    return 10; // Show 10 posts per page
});

Default: Uses admin setting or 5


bp_member_blog_dashboard_tabs

Customize which tabs appear in the member dashboard.

add_filter( 'bp_member_blog_dashboard_tabs', function( $tabs ) {
    // Remove the pending tab
    unset( $tabs['pending'] );
    return $tabs;
});

Default Tabs: postsdraftspending


Auto-Save

bpmb_autosave_min_interval

Change how often drafts are automatically saved (in seconds).

add_filter( 'bpmb_autosave_min_interval', function( $interval ) {
    return 60; // Auto-save every 60 seconds instead of 30
});

Default: 30 seconds


Categories

bpmb_max_categories_per_hour

Limit how many new categories members can create per hour.

add_filter( 'bpmb_max_categories_per_hour', function( $limit ) {
    return 3; // Only 3 new categories per hour
});

Default: 5 categories per hour


Security

bpmb_csp_policy

Customize the Content Security Policy headers on editor pages.

add_filter( 'bpmb_csp_policy', function( $policy ) {
    // Add a trusted domain for scripts
    $policy['script-src'] .= ' https://trusted-cdn.com';
    return $policy;
});

Access Control

bpmb_can_create_post

Control whether a user can create posts. Used by PRO plugin for restrictions/credits.

add_filter( 'bpmb_can_create_post', function( $can_create, $user_id ) {
    // Block users with less than 10 posts site-wide
    if ( count_user_posts( $user_id ) < 10 ) {
        return false;
    }
    return $can_create;
}, 10, 2 );

Parameters:

  • $can_create (bool) – Current permission status
  • $user_id (int) – User ID being checked

Actions

Post Lifecycle

bpmb_post_published

Triggered when a member post is published.

add_action( 'bpmb_post_published', function( $post_id, $author_id ) {
    // Send notification to admin
    wp_mail(
        get_option( 'admin_email' ),
        'New Member Post Published',
        'A new post was published: ' . get_permalink( $post_id )
    );
}, 10, 2 );

Parameters:

  • $post_id (int) – The published post ID
  • $author_id (int) – The post author’s user ID

buddypress_member_blog_post_save

Triggered when a post is saved (create or update).

add_action( 'buddypress_member_blog_post_save', function( $post_id ) {
    // Log the save action
    error_log( 'Post saved: ' . $post_id );
});

buddypress_member_blog_post_submit

Triggered when a post is submitted via the frontend form.

add_action( 'buddypress_member_blog_post_submit', function( $post_id, $post_data ) {
    // Add custom meta data
    update_post_meta( $post_id, '_submitted_from', 'frontend' );
}, 10, 2 );

View Tracking

bpmb_after_view_increment

Triggered after a post’s view count is incremented.

add_action( 'bpmb_after_view_increment', function( $post_id, $new_count ) {
    // Trigger something at 100 views
    if ( $new_count === 100 ) {
        // Send congratulations email to author
    }
}, 10, 2 );

Dashboard Navigation

bp_member_blog_dashboard_tabs_nav

Add content to the dashboard tab navigation area.

add_action( 'bp_member_blog_dashboard_tabs_nav', function() {
    echo 'Custom Tab';
});

bp_member_blog_dashboard_custom_tab

Handle content for custom dashboard tabs.

add_action( 'bp_member_blog_dashboard_custom_tab', function( $tab ) {
    if ( $tab === 'custom' ) {
        echo '
Custom tab content here
'
; } });

Form Hooks

bp_post_before_featured_image

Add content before the featured image upload field.

add_action( 'bp_post_before_featured_image', function() {
    echo '

Upload an eye-catching image

'
; });

bp_post_after_category

Add content after the category selector.

add_action( 'bp_post_after_category', function() {
    // Add custom field or options
});

bp_post_before_submit_button

Add content before the submit button.

add_action( 'bp_post_before_submit_button', function() {
    echo '';
});

Settings Hooks

bp_member_blog_add_access_settings_options

Add custom options to the Access & Permissions settings tab.

add_action( 'bp_member_blog_add_access_settings_options', function() {
    ?>
    
        Custom Access Option
        
    
    
});

bp_member_blog_add_editor_settings_options

Add custom options to the Editor settings tab.

add_action( 'bp_member_blog_add_editor_settings_options', function() {
    // Add custom editor settings
});

Common Customizations

Change Blog URL Slug

// In your theme's functions.php or a custom plugin
add_filter( 'bp_member_change_blog_slug', function() {
    return 'articles';
});

add_filter( 'bp_member_change_blog_label', function() {
    return 'My Articles';
});

Result: Member blog URL changes from /members/john/blog/ to /members/john/articles/


Restrict Posting to Verified Users

add_filter( 'bpmb_can_create_post', function( $can_create, $user_id ) {
    // Check for verified user meta
    $is_verified = get_user_meta( $user_id, 'account_verified', true );

    if ( ! $is_verified ) {
        return false;
    }

    return $can_create;
}, 10, 2 );

Add Custom Post Meta on Save

add_action( 'buddypress_member_blog_post_submit', function( $post_id ) {
    // Add submission timestamp
    update_post_meta( $post_id, '_frontend_submission_time', current_time( 'mysql' ) );

    // Add user's IP (for moderation)
    update_post_meta( $post_id, '_author_ip', $_SERVER['REMOTE_ADDR'] );
});

Notify Slack on New Posts

add_action( 'bpmb_post_published', function( $post_id, $author_id ) {
    $post = get_post( $post_id );
    $author = get_userdata( $author_id );

    $message = sprintf(
        'New post by %s: %s - %s',
        $author->display_name,
        $post->post_title,
        get_permalink( $post_id )
    );

    // Send to Slack webhook
    wp_remote_post( 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL', array(
        'body' => json_encode( array( 'text' => $message ) ),
        'headers' => array( 'Content-Type' => 'application/json' ),
    ));
}, 10, 2 );

Custom Dashboard Tab

// Add the tab
add_filter( 'bp_member_blog_dashboard_tabs', function( $tabs ) {
    $tabs['analytics'] = 'My Analytics';
    return $tabs;
});

// Handle the tab content
add_action( 'bp_member_blog_dashboard_custom_tab', function( $tab ) {
    if ( $tab === 'analytics' ) {
        $user_id = get_current_user_id();
        $total_views = get_user_meta( $user_id, 'total_post_views', true );

        echo '
'; echo '

Your Post Analytics

'
; echo '

Total Views: ' . intval( $total_views ) . '

'
; echo '
'
; } });

Limit Upload Types to JPEG Only

add_filter( 'bpmb_allowed_image_mime_types', function() {
    return array( 'image/jpeg' );
});

Increase Auto-Save Interval

// Save drafts every 2 minutes instead of 30 seconds
add_filter( 'bpmb_autosave_min_interval', function() {
    return 120;
});
Last updated: January 9, 2026