Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/22/2014 03:06:48 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Add parent and child menu classes to navigation menu. This allows for more flexible styling of hierarchical menus via the ability to target parent VS child items.

File:
1 edited

Legend:

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

    r8611 r8659  
    25162516            // Add this menu
    25172517            $menu         = new stdClass;
    2518             $menu->class  = array();
     2518            $menu->class  = array( 'menu-child' );
    25192519            $menu->css_id = $sub_nav['css_id'];
    25202520            $menu->link   = $sub_nav['link'];
     
    25242524            // If we're viewing this item's screen, record that we need to mark its parent menu to be selected
    25252525            if ( $sub_nav['slug'] == bp_current_action() ) {
    2526                 $menu->class      = array( 'current-menu-item' );
     2526                $menu->class[]    = 'current-menu-item';
    25272527                $selected_menus[] = $parent_menu;
    25282528            }
     
    25482548        // Add this menu
    25492549        $menu         = new stdClass;
    2550         $menu->class  = array();
     2550        $menu->class  = array( 'menu-parent' );
    25512551        $menu->css_id = $nav['css_id'];
    25522552        $menu->link   = $link;
     
    25562556        // Check if we need to mark this menu as selected
    25572557        if ( in_array( $nav['css_id'], $selected_menus ) )
    2558             $menu->class = array( 'current-menu-parent' );
     2558            $menu->class[] = 'current-menu-parent';
    25592559
    25602560        $menus[] = $menu;
Note: See TracChangeset for help on using the changeset viewer.