Merge pull request #727 from amsross/master

is_dropdown can evaluate to true even if depth is not specified in wp_nav_menu() arguments
This commit is contained in:
Ben Word
2013-04-04 18:00:35 -07:00

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) {