Fix 'taxonomy' and 'term' query var logic. See #12891

git-svn-id: https://develop.svn.wordpress.org/trunk@15860 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu 2010-10-20 12:07:23 +00:00
parent 8c710ff5e8
commit 2b08f69b50
2 changed files with 27 additions and 29 deletions

View File

@ -281,10 +281,7 @@ class WP {
}
}
if ( isset( $taxonomy_query_vars[$wpvar] ) ) {
$this->query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar];
$this->query_vars['term'] = $this->query_vars[$wpvar];
} elseif ( isset($post_type_query_vars[$wpvar] ) ) {
if ( isset($post_type_query_vars[$wpvar] ) ) {
$this->query_vars['post_type'] = $post_type_query_vars[$wpvar];
$this->query_vars['name'] = $this->query_vars[$wpvar];
}

View File

@ -1452,10 +1452,10 @@ class WP_Query extends WP_Object_Query {
if ( !empty($q['taxonomy']) && !empty($q['term']) ) {
$tax_query[] = array(
'taxonomy' => $q['taxonomy'],
'terms' => $q['term'],
'terms' => array( $q['term'] ),
'field' => 'slug',
);
}
} else {
foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) {
if ( $t->query_var && !empty( $q[$t->query_var] ) ) {
$tax_query_defaults = array(
@ -1486,6 +1486,7 @@ class WP_Query extends WP_Object_Query {
}
}
}
}
// Category stuff
if ( !empty($q['cat']) && '0' != $q['cat'] && !$this->is_singular ) {