Make sure get_bookmarks cache is an array

git-svn-id: https://develop.svn.wordpress.org/trunk@10229 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-12-19 07:05:51 +00:00
parent 12035893fc
commit cc7454270c

View File

@ -142,10 +142,15 @@ function get_bookmarks($args = '') {
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$cache = array();
$key = md5( serialize( $r ) );
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) )
if ( isset( $cache[ $key ] ) )
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
if ( is_array($cache) && isset( $cache[ $key ] ) )
return apply_filters('get_bookmarks', $cache[ $key ], $r );
}
if ( !is_array($cache) )
$cache = array();
$inclusions = '';
if ( !empty($include) ) {