MainWP Community

Disable BuddyPress Posting for Specific Users

Disable BuddyPress posting for specific users on child sites.

Snippet Type

Execute on Child Sites

Snippet

function bp_disable_activity_for_specific_users() {

    $forbidden_users_ids  = array( 10, 33, 40 );

    if ( in_array( bp_loggedin_user_id(), $forbidden_users_ids ) ) {
        add_filter( 'bp_is_wall_posting_form_active', '__return_false' );
    }

}

add_action( 'bp_init', 'bp_disable_activity_for_specific_users' );
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.