Skip to:
Content

BuddyPress.org

Changeset 11518


Ignore:
Timestamp:
03/21/2017 02:14:45 AM (8 years ago)
Author:
boonebgorges
Message:

Better current-item determination in bp_nav_menu().

Current component *and* action should both be matched when
determining current item, so as to avoid clashes when two
top-level items have children by the same name.

Props lakrisgubben.
Fixes #4986.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r11447 r11518  
    36093609
    36103610                // If we're viewing this item's screen, record that we need to mark its parent menu to be selected.
    3611                 if ( $sub_menu->slug == bp_current_action() ) {
     3611                if ( bp_is_current_action( $sub_menu->slug ) && bp_is_current_component( $nav_menu->slug ) ) {
    36123612                    $menu->class[]    = 'current-menu-parent';
    36133613                    $submenu->class[] = 'current-menu-item';
Note: See TracChangeset for help on using the changeset viewer.