Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to unset submenu tab

  • @whoaloic

    Participant

    Hello,
    I know thanks to forum how to remove menu tabl:

    function remove_menu_tabs(){
    global $bp;
    unset($bp->bp_nav['profile']);
    }
    add_action('bp_setup_nav', 'remove_menu_tabs', 201);

    But anybody know how to unset submenu tabs?
    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @danbp

    Participant
    function bpfr_remove_change_avatar_tab() {
    global $bp;
    	bp_core_remove_subnav_item( 'profile', 'change-avatar' );
    
    }
    add_action( 'bp_ready', 'bpfr_remove_change_avatar_tab', 15 );

    BuddyBar items

    Source: bp-core-buddybar.php
    function bp_core_remove_subnav_item( $parent_id, $slug )
    and to remove a nav item
    function bp_core_remove_nav_item( $parent_id )

    @whoaloic

    Participant

    Hello Dan=
    Thank you for the snippet.

    This one is working too:

    /* remove tabs*/
    function remove_menu_tabs(){
    global $bp;
    unset($bp->bp_nav['profile']);
    unset($bp->bp_options_nav['profile']['change-avatar']);
    }
    add_action('bp_setup_nav', 'remove_menu_tabs', 201);

    @pnet

    Participant

    I am trying to do the same, I tried these codes and it’s not working.
    I added to my bp-custom.php file.
    Maybe I am doing something wrong???

    My ultimate goal is to hide specific profile menu options based on the users role, this looked like a good starting place, I must be missing something??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] How to unset submenu tab’ is closed to new replies.
Skip to toolbar