How to make section of profile private?
-
Hello, I have Buddypress and Achievements for WordPress (the author is not active or providing support). This is an internal company site and I want to make the Achievements private so that users can only see their own achievements.
I’ve figured out how to make the xprofile Achievements tab only appear for the current user and admins with this code:
function hide_achievements_from_users() { global $bp; if ((bp_loggedin_user_id() == bp_displayed_user_id()) || (current_user_can('manage_options'))){ return; } bp_core_remove_nav_item('achievements'); } add_action( 'bp_setup_nav', 'hide_achievements_from_users', 99 );
However a user can still browse other user’s achievements by manually typing out the url like http://mysite.com/members/username/achievements/
Is there a way I can make this section of user’s profiles private so that only they (and admins) can view it? Users should still be able to visit another user’s profile, it is only the /achievements/ at the end of the URL which needs to be blocked.
- The topic ‘How to make section of profile private?’ is closed to new replies.