Guard against empty $cat_counts array. http://wordpress.org/support/3/6080

git-svn-id: https://develop.svn.wordpress.org/trunk@1389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-06-06 07:21:58 +00:00
parent 44d532c6e3
commit 650a1a3a56
2 changed files with 8 additions and 6 deletions

View File

@ -1409,7 +1409,7 @@ function check_comment($author, $email, $url, $comment, $user_ip) {
}
function query_posts($query) {
global $wpdb, $pagenow, $request;
global $wpdb, $pagenow, $request, $user_ID;
parse_str($query);

View File

@ -312,11 +312,13 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
INNER JOIN $wpdb->posts ON (ID = post_id)
WHERE post_status = 'publish' $exclusions
GROUP BY category_id");
foreach ($cat_counts as $cat_count) {
if (1 != intval($hide_empty) || $cat_count > 0) {
$category_posts["$cat_count->cat_ID"] = $cat_count->cat_count;
}
}
if (! empty($cat_counts)) {
foreach ($cat_counts as $cat_count) {
if (1 != intval($hide_empty) || $cat_count > 0) {
$category_posts["$cat_count->cat_ID"] = $cat_count->cat_count;
}
}
}
}
if (intval($optiondates) == 1) {