Don't show category counts from the future.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-02-11 03:43:56 +00:00
parent 34da840f28
commit e8699e2099
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) {