Don't show category counts from the future.

git-svn-id: https://develop.svn.wordpress.org/trunk@2270 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2005-02-11 03:43:56 +00:00
parent 322382ae61
commit 9c49e1b2a4
1 changed files with 3 additions and 1 deletions

View File

@ -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) {