Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

has-dropdown class appears when $depth set to 1 #35

Merged
merged 1 commit into from
Apr 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/menu-walker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class top_bar_walker extends Walker_Nav_Menu {
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
$element->has_children = !empty( $children_elements[$element->ID] );
$element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';
$element->classes[] = ( $element->has_children ) ? 'has-dropdown' : '';
$element->classes[] = ( $element->has_children && $max_depth !== 1 ) ? 'has-dropdown' : '';

parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
}
Expand Down