From 06c03489bb325c05719ada9ae6751532fe9258d3 Mon Sep 17 00:00:00 2001 From: Matt Ross Date: Thu, 28 Mar 2013 22:47:17 -0300 Subject: [PATCH 1/2] 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. --- lib/nav.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nav.php b/lib/nav.php index b4b516e..51b4b17 100644 --- a/lib/nav.php +++ b/lib/nav.php @@ -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) { From 6b988418cbb40c3388912fb2ab71691e4a4572fc Mon Sep 17 00:00:00 2001 From: Matt Ross Date: Thu, 4 Apr 2013 21:48:08 -0300 Subject: [PATCH 2/2] Spacing adjustments --- lib/nav.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nav.php b/lib/nav.php index 51b4b17..3ce0314 100644 --- a/lib/nav.php +++ b/lib/nav.php @@ -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 || ( $max_depth === 0 )))); + $element->is_dropdown = ((!empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth || ($max_depth === 0)))); if ($element->is_dropdown) { if ($depth === 0) {