From 33e4ff5f55d80c54307dfd5655099c17c309fd79 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Fri, 21 Nov 2008 17:17:18 +0000 Subject: [PATCH] Make arguments to start_el consistent and ensure that page walking is consistent. Fixes #8303 and #8091 props filosofo. git-svn-id: https://develop.svn.wordpress.org/trunk@9830 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/classes.php | 4 ++-- wp-includes/post-template.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index b49a20d7bb..b1c117c041 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -822,7 +822,7 @@ class Walker { $id_field = $this->db_fields['id']; //display this element - if ( ! empty( $args[0] ) ) + if ( is_array( $args[0] ) ) $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] ); $cb_args = array_merge( array(&$output, $element, $depth), $args); call_user_func_array(array(&$this, 'start_el'), $cb_args); @@ -1152,7 +1152,7 @@ class Walker_Page extends Walker { * @param int $current_page Page ID. * @param array $args */ - function start_el(&$output, $page, $depth, $current_page, $args) { + function start_el(&$output, $page, $depth, $args, $current_page) { if ( $depth ) $indent = str_repeat("\t", $depth); else diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 875d400db0..703e84be66 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -687,9 +687,9 @@ function wp_page_menu( $args = array() ) { * @since 2.1.0 * @see Walker_Page::walk() for parameters and return description. */ -function walk_page_tree() { +function walk_page_tree($pages, $depth, $current_page, $r) { $walker = new Walker_Page; - $args = func_get_args(); + $args = array($pages, $depth, $r, $current_page); return call_user_func_array(array(&$walker, 'walk'), $args); }