Make member profile private based on member type.
-
Hello everyone, thanks in advance …..
I have a buddypress with different members types, coaches and players.
I’m trying to make private members profiles with type = coaches with this code:function member_profile_test(){ $user_id = bp_displayed_user_id(); $member_type = bp_get_member_type($user_id); if($member_type !== 'players' && !is_super_admin() && !bp_is_my_profile()){ wp_redirect(home_url() . '/error'); } } add_action( 'bp_before_member_home_content', 'member_profile_test' );
But at this point (‘bp_before_member_home_content’) it is too late, the site has already begun to write content and wp_redirect display an error in php.
What is the right way to do this?
Thank for your help…. Sorry for my english…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Make member profile private based on member type.’ is closed to new replies.