From 9c49e1b2a45f506faab40f3c4c31825e7d2bb4d6 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Fri, 11 Feb 2005 03:43:56 +0000 Subject: [PATCH] Don't show category counts from the future. git-svn-id: https://develop.svn.wordpress.org/trunk@2270 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/template-functions-category.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index 390410823c..42b9dbf561 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -279,12 +279,14 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde $categories = $wpdb->get_results($query); } if (!count($category_posts)) { + $now = current_time('mysql', 1); $cat_counts = $wpdb->get_results(" SELECT cat_ID, COUNT($wpdb->post2cat.post_id) AS cat_count FROM $wpdb->categories INNER JOIN $wpdb->post2cat ON (cat_ID = category_id) INNER JOIN $wpdb->posts ON (ID = post_id) - WHERE post_status = 'publish' $exclusions + WHERE post_status = 'publish' + AND post_date_gmt < '$now' $exclusions GROUP BY category_id"); if (! empty($cat_counts)) { foreach ($cat_counts as $cat_count) {