Permalink
Browse files

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.
  • Loading branch information...
1 parent b6e4e92 commit 06c03489bb325c05719ada9ae6751532fe9258d3 @amsross amsross committed Mar 29, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/nav.php
View
@@ -38,7 +38,7 @@ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
}
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) {

0 comments on commit 06c0348

Please sign in to comment.