mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01:00
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:
parent
34da840f28
commit
e8699e2099
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user