From ad0b56690ab945035006d4359d93e93710241438 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 11 Jun 2009 00:04:20 +0000 Subject: [PATCH] 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 --- wp-includes/general-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index b1dc9a9b11..68c73cedaa 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -969,7 +969,7 @@ function get_calendar($initial = true) { // Quick check. If we have no posts at all, abort! 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 ) { $cache[ $key ] = ''; wp_cache_set( 'get_calendar', $cache, 'calendar' );