From 4a60e70973b4c78e0f20caf6c42430efd3e4f14b Mon Sep 17 00:00:00 2001 From: azaozz 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: http://svn.automattic.com/wordpress/trunk@11548 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 b1dc9a9b1..68c73ceda 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' );