Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: deny access to subscriber profile

@kwavewd

Participant

this code works perfectly to block the admin

// deny access to admins profile. User is redirected to the homepage
function bpfr_hide_admins_profile() {
global $bp;
if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
wp_redirect( home_url() );
exit;
endif;
}
add_action( ‘wp’, ‘bpfr_hide_admins_profile’, 1 );

can’t we just change

if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
wp_redirect( home_url() );

and make it subscribers in stead of id and loggedin d?

Skip to toolbar