From aa82383dc67ee45233974ca7aa6f45e8baf56e0a Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 2 Apr 2007 19:40:15 +0000 Subject: [PATCH] Fix category_name=foo WP_Queries. fixes #4069 git-svn-id: https://develop.svn.wordpress.org/trunk@5171 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 40f5f8b12a..d2964ca5a3 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -916,7 +916,7 @@ class WP_Query { $tables = ", $wpdb->post2cat, $wpdb->categories"; $join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) LEFT JOIN $wpdb->categories ON ($wpdb->post2cat.category_id = $wpdb->categories.cat_ID) "; - $whichcat = " AND category_id IN ({$q['cat']} "; + $whichcat = " AND category_id IN ({$q['cat']}, "; $whichcat .= get_category_children($q['cat'], '', ', '); $whichcat = substr($whichcat, 0, -2); $whichcat .= ") AND rel_type = 'category'";