Just over 3 years ago, the moderator, Danbp, had the once working code that went straight into your bp-custom.php file:
// 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 );
**However, this no longer works with all those updates to the plugin.
Anyone have an idea on what would be the up to date code that would work to actually deny all non-admin users access to admins profile?