WordPress.org

Make WordPress Core

Ticket #5248: query-path.php

File query-path.php, 728 bytes (added by jaroche, 8 years ago)
Line 
1Index: query.php
2===================================================================
3--- query.php   (revision 6282)
4+++ query.php   (working copy)
5@@ -974,7 +974,7 @@
6                        $q['cat'] = $reqcat;
7 
8                        $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
9-                       $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
10+                       $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
11                        $in_cats = array($q['cat']);
12                        $in_cats = array_merge($in_cats, get_term_children($q['cat'], 'category'));
13                        $in_cats = "'" . implode("', '", $in_cats) . "'";