Skip to:
Content
Pages
Categories
Search
Top
Bottom

hOw to remove bp nav items from adminbar ONLY ?

  • Avatar of imjscn
    imjscn
    Participant

    @imjscn

    I want to remove some less useful nav items from adminbar, but keep them on memeber’s nav items tab. But my code removed them from both places. Is there a way to remove only from adminbar?

    This is the code I use: ‘bp_core_remove_subnav_item($bp->activity->slug, ‘groups’);’

    Need help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @mercime , thanks for the link. I did that on bp_adminbar_login_menu successfully, but when it comes to bp_adminbar_account_menu, the array codes beyond my ability, so I am thinking to use bp_core_remove_subnav_item. Maybe it’s not the way–still need to work with the bp_options_nav array.
    This is where bp get the sub-nav:
    ` $counter = 0;
    foreach( (array)$bp->bp_nav as $nav_item ) {
    $alt = ( 0 == $counter % 2 ) ? ‘ class=”alt”‘ : ”;

    echo ‘

  • ‘;
    echo ‘‘ . $nav_item . ‘‘;

    if ( is_array( $bp->bp_options_nav[$nav_item] ) ) {
    echo ‘

      ‘;
      $sub_counter = 0;

      foreach( (array)$bp->bp_options_nav[$nav_item] as $subnav_item ) {
      $link = str_replace( $bp->displayed_user->domain, $bp->loggedin_user->domain, $subnav_item );
      $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item );
      $alt = ( 0 == $sub_counter % 2 ) ? ‘ class=”alt”‘ : ”;
      echo ‘

    • ‘ . $name . ‘
    • ‘;
      $sub_counter++;
      }
      echo ‘

    ‘;
    }

    echo ‘

  • ‘;
    `
    How can I check this array and filter items inside?

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

You must be logged in to reply to this topic.