bp_core_remove_nav_item is not for removing nav item tabs?
-
What is the best way to remove user tabs? bp_core_remove_nav_item, after many years now, still doesn’t seem to be the solution. This method doesn’t only remove the link from the menu, it disables the component entirely unless I’m missing something because it seems to be offered up as the accepted solution on several threads.
I’ve even tried
bp_core_remove_nav_item in combo with add_action(‘bp_screens’, $screen_function) to re-add component screens >> worked somewhat but had other issues
So I ended up with just overwriting the members/single/parts/item-nav.php file
<nav class="<?php bp_nouveau_single_item_nav_classes(); ?>" id="object-nav" role="navigation" aria-label="<?php esc_attr_e( 'Member menu', 'buddypress' ); ?>"> <?php if ( bp_nouveau_has_nav( array( 'type' => 'primary' ) ) ) : ?> <ul> <?php while ( bp_nouveau_nav_items() ) : bp_nouveau_nav_item(); ?> <?php /*/////////////////////////////////// stopping the nav items here ///////////////////////////////*/?> <?php if(!in_array( bp_nouveau_get_nav_link_text(), array('Settings', 'Notifications', 'Messages')) ):?> <li id="<?php bp_nouveau_nav_id(); ?>" class="<?php bp_nouveau_nav_classes(); ?>"> <a href="<?php bp_nouveau_nav_link(); ?>" id="<?php bp_nouveau_nav_link_id(); ?>"> <?php bp_nouveau_nav_link_text(); ?> <?php if ( bp_nouveau_nav_has_count() ) : ?> <span class="count"><?php bp_nouveau_nav_count(); ?></span> <?php endif; ?> </a> </li> <?php endif;?> <?php endwhile; ?> <?php bp_nouveau_member_hook( '', 'options_nav' ); ?> </ul> <?php endif; ?> </nav>
What is the way to do this?
- You must be logged in to reply to this topic.