diff --git a/wp-includes/post.php b/wp-includes/post.php index 7cf1832816..5528f48af7 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2127,14 +2127,18 @@ function &get_pages($args = '') { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); + $cache = array(); $key = md5( serialize( compact(array_keys($defaults)) ) ); if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) { - if ( isset( $cache[ $key ] ) ) { + if ( is_array($cache) && isset( $cache[ $key ] ) ) { $pages = apply_filters('get_pages', $cache[ $key ], $r ); return $pages; } } + if ( !is_array($cache) ) + $cache = array(); + $inclusions = ''; if ( !empty($include) ) { $child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include