Fix check for a published post in calendar widget, props Denis-de-Bernardy, fixes #10091
git-svn-id: https://develop.svn.wordpress.org/trunk@11548 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c45adb5e47
commit
ad0b56690a
|
@ -969,7 +969,7 @@ function get_calendar($initial = true) {
|
||||||
|
|
||||||
// Quick check. If we have no posts at all, abort!
|
// Quick check. If we have no posts at all, abort!
|
||||||
if ( !$posts ) {
|
if ( !$posts ) {
|
||||||
$gotsome = $wpdb->get_var("SELECT 1 FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
|
$gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
|
||||||
if ( !$gotsome ) {
|
if ( !$gotsome ) {
|
||||||
$cache[ $key ] = '';
|
$cache[ $key ] = '';
|
||||||
wp_cache_set( 'get_calendar', $cache, 'calendar' );
|
wp_cache_set( 'get_calendar', $cache, 'calendar' );
|
||||||
|
|
Loading…
Reference in New Issue