diff --git a/wp-includes/post.php b/wp-includes/post.php index 509a5dcfa1..efa616745d 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2400,8 +2400,10 @@ function &get_page_children($page_id, $pages) { */ function &get_page_hierarchy( &$pages, $page_id = 0 ) { - if ( empty( $pages ) ) - return null; + if ( empty( $pages ) ) { + $result = null; + return $result; + } $children = array(); foreach ( (array) $pages as $p ) {