Make sure get_calendar cache is an array
git-svn-id: https://develop.svn.wordpress.org/trunk@10228 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bf2cfefdff
commit
12035893fc
@ -902,14 +902,18 @@ function calendar_week_mod($num) {
|
||||
function get_calendar($initial = true) {
|
||||
global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
|
||||
|
||||
$cache = array();
|
||||
$key = md5( $m . $monthnum . $year );
|
||||
if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
|
||||
if ( isset( $cache[ $key ] ) ) {
|
||||
if ( is_array($cache) && isset( $cache[ $key ] ) ) {
|
||||
echo $cache[ $key ];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !is_array($cache) )
|
||||
$cache = array();
|
||||
|
||||
ob_start();
|
||||
// Quick check. If we have no posts at all, abort!
|
||||
if ( !$posts ) {
|
||||
|
Loading…
Reference in New Issue
Block a user