Hi,
I found the following function that prevents anyone from accessing admin’s profile:
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 );
Unfortunately, it is based on user id. I need something that is based on user role.
What I need is to prevent subscribers from having access on any other’s user profile page.
Thank you in advance for any help