From 9ac4ff37f013a347a6754e6e147eaad2d2fa55b6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 29 Dec 2009 21:11:59 +0000 Subject: [PATCH] Return empty array instead of null. Props Denis-de-Bernardy. fixes #11661 for 2.9 git-svn-id: https://develop.svn.wordpress.org/branches/2.9@12572 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index f0427c16d..2e9807138 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2391,8 +2391,10 @@ function &get_page_children($page_id, $pages) { */ function &get_page_hierarchy( &$pages, $page_id = 0 ) { - if ( empty( $pages ) ) - return null; + if ( empty( $pages ) ) { + $return = array(); + return $return; + } $children = array(); foreach ( (array) $pages as $p ) {