Removing bp_nav menu item for specific users
-
BP 1.6.5
WP 3.5.1My buddypress environment has two distinct profile types set by an x-profile field.
I’m using BP-Media which adds a media tab to a users menu
I want to remove that tab from one profile types menus.
I’m guessing I need to remove it from both the bp_is_my_profile() nav layout and the public nav layout…. When i try setting a global bp_core_remove_nav_item(‘media’) it removes it from other peoples pages but break my own profileHeres what I’ve got so far:
//For own profile //First i need the logged in users id global $bp $userid = $bp->loggedin_user['id'] //Then use that ID to work out what type of user they are $usertype = bp_profile_field_data( 'field=User Type&user_id=$userid' ); if ($usertype == 'type1'){ function remove_media_tab(){ bp_core_remove_nav_item('media'); } } add_action('bp_friends_setup_nav','remove_media_tab');
Direction, advice and comments appreciated!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Removing bp_nav menu item for specific users’ is closed to new replies.