changed is_dropdown evaluation

is_dropdown can evaluate to true even if max_depth is 0. This is the WordPress default and implies that dropdowns are enabled.
This commit is contained in:
Matt Ross
2013-03-28 22:47:17 -03:00
parent b6e4e92278
commit 06c03489bb

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]) && (($depth + 1) < $max_depth)));
$element->is_dropdown = ((!empty($children_elements[$element->ID] ) && (($depth + 1 ) < $max_depth || ( $max_depth === 0 ))));
if ($element->is_dropdown) {
if ($depth === 0) {