summaryrefslogtreecommitdiffstats
path: root/wp-includes/classes.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-22 11:44:06 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-22 11:44:06 +0000
commitb2f9804dae80c5f6c70c70e92a3bbde67e2615c5 (patch)
tree7615f215a90e4c797702547dab832d30887a0a54 /wp-includes/classes.php
parent4e71faf4fa1a98517df1c83be342dd3714f504d2 (diff)
downloadwordpress-mu-b2f9804dae80c5f6c70c70e92a3bbde67e2615c5.tar.gz
wordpress-mu-b2f9804dae80c5f6c70c70e92a3bbde67e2615c5.tar.xz
wordpress-mu-b2f9804dae80c5f6c70c70e92a3bbde67e2615c5.zip
WP Merge to 4780
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@854 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/classes.php')
-rw-r--r--wp-includes/classes.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/wp-includes/classes.php b/wp-includes/classes.php
index 47470d3..931eb43 100644
--- a/wp-includes/classes.php
+++ b/wp-includes/classes.php
@@ -428,14 +428,14 @@ class Walker {
if ( !empty($previous_element) && ($element->$parent_field == $previous_element->$id_field) ) {
// Previous element is my parent. Descend a level.
array_unshift($parents, $previous_element);
- $depth++; //always do this so when we start the element further down, we know where we are
if ( !$to_depth || ($depth < $to_depth) ) { //only descend if we're below $to_depth
- $cb_args = array_merge( array($output, $depth - 1), $args);
+ $cb_args = array_merge( array($output, $depth), $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);
+ } else if ( $to_depth && $depth == $to_depth ) { // If we've reached depth, end the previous element.
+ $cb_args = array_merge( array($output, $previous_element, $depth), $args);
$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
}
+ $depth++; //always do this so when we start the element further down, we know where we are
} else if ( $element->$parent_field == $previous_element->$parent_field) {
// On the same level as previous element.
if ( !$to_depth || ($depth <= $to_depth) ) {
@@ -452,7 +452,7 @@ class Walker {
while ( $parent = array_shift($parents) ) {
$depth--;
if ( !$to_depth || ($depth < $to_depth) ) {
- $cb_args = array_merge( array($output, $depth - 1), $args);
+ $cb_args = array_merge( array($output, $depth), $args);
$output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
$cb_args = array_merge( array($output, $parent, $depth - 1), $args);
$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
@@ -490,7 +490,7 @@ class Walker_Page extends Walker {
function start_lvl($output, $depth) {
$indent = str_repeat("\t", $depth);
- $output .= "$indent<ul>\n";
+ $output .= "\n$indent<ul>\n";
return $output;
}