From 384edd177b8fc91654c25263a34a5e3eacee9a2b Mon Sep 17 00:00:00 2001 From: saxmatt Date: Fri, 2 Jan 2004 19:27:21 +0000 Subject: [PATCH] Use post_status in get_lastpostdate git-svn-id: http://svn.automattic.com/wordpress/trunk@686 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f5d6f7e93..13d159498 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -377,9 +377,8 @@ function get_lastpostdate() { if ((!isset($cache_lastpostdate)) OR (!$use_cache)) { $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600))); - $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date <= '$now' ORDER BY post_date DESC LIMIT 1"); + $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date <= '$now' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); $cache_lastpostdate = $lastpostdate; -// echo $lastpostdate; } else { $lastpostdate = $cache_lastpostdate; }