Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to hide the tab ‘friends’ from other users


  • cptghost1994
    Participant

    @cptghost1994

    Say I want to make it so that no one can view a certain menu item in a users profile EXCEPT FOR the user whos profile it is, how do I do that.

    So say I am user1 and I go to my profile, I should be able to see the Friends tab; now if I as user1 goes to user2 profile page, their Friends menu item should not be visible.

    Any way to do this? All help GREATLY appreciated!

Viewing 1 replies (of 1 total)

  • kayart
    Participant

    @kayart

    function hide_friends_tabs_for_other_users() {
    	if ( bp_is_user() && !bp_is_my_profile() ) {
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_subnav_item( 'activity', 'friends' );
    	}
    }
    add_action( 'bp_setup_nav', 'hide_friends_tabs_for_other_users', 10 );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar