Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] Hide Admin from Members and Activity

@emretheaviator

Participant

In short I need this code to redirect to 404 page not homepage. Thank you.

// 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 );
Skip to toolbar