mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-30 18:24:31 +00:00
Use get_term_children() and get_term_field(). see #4189
git-svn-id: https://develop.svn.wordpress.org/trunk@5660 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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') ) {
|
||||
|
||||
Reference in New Issue
Block a user