diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 8a56dbb8e6..d1dcdf1d06 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -172,8 +172,8 @@ function category_description($category = 0) { global $cat; if ( !$category ) $category = $cat; - $category = & get_category($category); - return apply_filters('category_description', $category->description, $category->term_id); + + return get_term_field('description', $category, 'category'); } function wp_dropdown_categories($args = '') { diff --git a/wp-includes/query.php b/wp-includes/query.php index 2b6e44645d..676a94164c 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -915,15 +915,13 @@ class WP_Query { $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' "; - $whichcat .= "AND $wpdb->term_taxonomy.term_id IN ({$q['cat']}, "; - $whichcat .= get_category_children($q['cat'], '', ', '); - $whichcat = substr($whichcat, 0, -2); - $whichcat .= ")"; + $in_cats = array($q['cat']); + $in_cats = array_merge($in_cats, get_term_children($q['cat'], 'category')); + $in_cats = "'" . implode("', '", $in_cats) . "'"; + $whichcat .= "AND $wpdb->term_taxonomy.term_id IN ($in_cats)"; $groupby = "{$wpdb->posts}.ID"; } - - // Author/user stuff if ( empty($q['author']) || ($q['author'] == '0') ) {