From b3b788503e45b8a1b7928bdad5791acf78356c64 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 26 Nov 2009 05:22:09 +0000 Subject: [PATCH] Get the right number of pages then excluding a tree, fixes #11205 git-svn-id: https://develop.svn.wordpress.org/trunk@12279 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index 5ce85f4799..80bf43a26e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2599,6 +2599,7 @@ function &get_pages($args = '') { foreach ( $children as $child ) $excludes[] = $child->ID; $excludes[] = $exclude; + $num_pages = count($pages); for ( $i = 0; $i < $num_pages; $i++ ) { if ( in_array($pages[$i]->ID, $excludes) ) unset($pages[$i]);