Fix for navbar dropdowns

Navbar items with children broke if the menu depth excluded the children.
Such as: wp_nav_menu(array('depth' => 1)) where 2nd level children exist
This commit is contained in:
kara-todd
2013-03-08 14:01:14 -05:00
parent 44dd8f120b
commit 302579705d

View File

@@ -38,7 +38,7 @@ class Roots_Nav_Walker extends Walker_Nav_Menu {
}
function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {
$element->is_dropdown = !empty($children_elements[$element->ID]);
$element->is_dropdown = ((!empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth)));
if ($element->is_dropdown) {
if ($depth === 0) {