Close previous element when depth is hit. fixes #3080
git-svn-id: http://svn.automattic.com/wordpress/trunk@4564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bdb9f687b5
commit
d5e1cc7a6f
|
@ -430,6 +430,9 @@ class Walker {
|
|||
if ( !$to_depth || ($depth < $to_depth) ) { //only descend if we're below $to_depth
|
||||
$cb_args = array_merge( array($output, $depth - 1), $args);
|
||||
$output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
|
||||
} else { // If we've reached depth, end the previous element.
|
||||
$cb_args = array_merge( array($output, $previous_element, $depth - 1), $args);
|
||||
$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
|
||||
}
|
||||
} else if ( $element->$parent_field == $previous_element->$parent_field) {
|
||||
// On the same level as previous element.
|
||||
|
|
Loading…
Reference in New Issue