From 9055457e8213ad55e0f9229b5e92183609514474 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 28 Feb 2006 11:19:04 +0000 Subject: [PATCH] Fix page walk bug. fixes #2516 git-svn-id: https://develop.svn.wordpress.org/trunk@3578 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c7844714ca..973417d6d8 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -747,7 +747,7 @@ function walk_page_tree($pages, $to_depth, $start_element_callback, $end_element $cb_args = array_merge( array($output, $depth), $args); $output = call_user_func_array($start_level_callback, $cb_args); } - } else if ( $depth && ($page->post_parent == $parents[0]->ID) ) { + } else if ( $depth && ($page->post_parent == $previous_page->post_parent) ) { // On the same level as previous page. if ( !$to_depth || ($depth < $to_depth) ) { if ( !empty($end_element_callback) ) {