From 11aea9b0bc9cbbc049725fe628a6142b29fc6bb2 Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Thu, 17 Feb 2005 00:11:35 +0000 Subject: [PATCH] whoops, make wp_list_pages not spew a warning when there are no pages git-svn-id: http://svn.automattic.com/wordpress/trunk@2360 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-post.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/template-functions-post.php b/wp-includes/template-functions-post.php index b4978f38b1..f735430040 100644 --- a/wp-includes/template-functions-post.php +++ b/wp-includes/template-functions-post.php @@ -297,10 +297,12 @@ function get_pages($args = '') { "$exclusions " . "ORDER BY " . $r['sort_column'] . " " . $r['sort_order']); - foreach($pages as $page) { - $cache_pages[$page->ID] = $page; + $cache_pages = array(); + if (count($pages)) { + foreach($pages as $page) { + $cache_pages[$page->ID] = $page; + } } - } return $cache_pages;