Hi there, I want to remove the Settings tab from profile, but keep the settings option in menu items
This function removes settings globally, how do I remove settings nav tab only?
Regards
Carstenfunction bphelp_remove_settings_from_profile(){ bp_core_remove_nav_item('settings'); } add_action('bp_settings_setup_nav','bphelp_remove_settings_from_profile');
Hi there, There are several ways out there to remove a nav item, but what is the right way?
false
or
bp_core_remove_nav_item
And which one removes only the nav tab, but not the functionality?
In my case the Settings, which I want to display in the Main menu of my theme only, not in BP navs?
I hope you can bring some clarification to this topic.
Regards
CarstenSolution one:
$bp->bp_nav[‘settings’] = false;
(does not work)Solution two:
function bphelp_remove_settings_from_profile(){ bp_core_remove_nav_item('settings'); } add_action('bp_settings_setup_nav','bphelp_remove_settings_from_profile');
Solution three inclusive Group tabs:
function bpex_hide_profile_menu_tabs() { if( bp_is_active( 'xprofile' ) ) : if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) { // BP's profile main menu items. Comment those to show. // bp_core_remove_nav_item( 'activity' ); bp_core_remove_nav_item( 'profile' ); bp_core_remove_nav_item( 'friends' ); bp_core_remove_nav_item( 'groups' ); // exist only if you use bbPress bp_core_remove_nav_item( 'forums' ); // BP's profile main menu items. Comment those to show. // bp_core_remove_subnav_item( 'activity', 'personnal' ); bp_core_remove_subnav_item( 'activity', 'mentions' ); bp_core_remove_subnav_item( 'activity', 'favorites' ); bp_core_remove_subnav_item( 'activity', 'friends' ); bp_core_remove_subnav_item( 'activity', 'groups' ); } endif; } add_action( 'bp_setup_nav', 'bpex_hide_profile_menu_tabs', 15 ); function bpex_remove_group_tabs() { if ( ! bp_is_group() ) { return; } $slug = bp_get_current_group_slug(); // hide items to all users except site admin if ( !is_super_admin() ) { // bp_core_remove_subnav_item( $slug, 'members' ); bp_core_remove_subnav_item( $slug, 'send-invites' ); // bp_core_remove_subnav_item( $slug, 'admin' ); // bp_core_remove_subnav_item( $slug, 'forum' ); } } add_action( 'bp_actions', 'bpex_remove_group_tabs' );
Hello Carsten,
Thank you for posting. If you want to keep the functionality then a better way to remove the settings tab is to hide this tab using the CSS rule. If you are okay with this approach. Please let me know which template pack you are using.
Regards
Ravi
The topic ‘ [Resolved] remove settings from nav tab only’ is closed to new replies.