Make sure get_calendar cache is an array
git-svn-id: http://svn.automattic.com/wordpress/trunk@10228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
980a3bc810
commit
61ff0372e4
|
@ -902,14 +902,18 @@ function calendar_week_mod($num) {
|
||||||
function get_calendar($initial = true) {
|
function get_calendar($initial = true) {
|
||||||
global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
|
global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
|
||||||
|
|
||||||
|
$cache = array();
|
||||||
$key = md5( $m . $monthnum . $year );
|
$key = md5( $m . $monthnum . $year );
|
||||||
if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
|
if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
|
||||||
if ( isset( $cache[ $key ] ) ) {
|
if ( is_array($cache) && isset( $cache[ $key ] ) ) {
|
||||||
echo $cache[ $key ];
|
echo $cache[ $key ];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !is_array($cache) )
|
||||||
|
$cache = array();
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
// Quick check. If we have no posts at all, abort!
|
// Quick check. If we have no posts at all, abort!
|
||||||
if ( !$posts ) {
|
if ( !$posts ) {
|
||||||
|
|
Loading…
Reference in New Issue