Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_core_remove_nav_item is not for removing nav item tabs?


  • Nahum
    Participant

    @nahummadrid

    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?

Viewing 2 replies - 1 through 2 (of 2 total)

  • haywardgb
    Participant

    @haywardgb

    Did you ever get this figured out ? I’ve been pulling my hair out trying to figure this one out. You’d think they’d add the option to turn off default menu options as default? lol


    Nahum
    Participant

    @nahummadrid

    over riding that file in child theme with what i mentioned above is what i am sticking with currently at least for my purposes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar