Close previous element when depth is hit. fixes #3080

git-svn-id: https://develop.svn.wordpress.org/trunk@4564 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-12-01 00:38:25 +00:00
parent f2fe75585f
commit 56a74de876

View File

@ -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.