whoops, make wp_list_pages not spew a warning when there are no pages

git-svn-id: https://develop.svn.wordpress.org/trunk@2360 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
michelvaldrighi 2005-02-17 00:11:35 +00:00
parent cdc96a2cc5
commit 7a45d0e309
1 changed files with 5 additions and 3 deletions

View File

@ -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;