Fix tax=term1+term2 queries. See #12891

git-svn-id: http://svn.automattic.com/wordpress/trunk@15874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-10-20 19:00:57 +00:00
parent 080d1b0969
commit 0319925e7f
1 changed files with 3 additions and 3 deletions

View File

@ -1470,10 +1470,10 @@ class WP_Query extends WP_Object_Query {
$q['term'] = basename($q['term']); $q['term'] = basename($q['term']);
} }
$term = $q[$t->query_var]; $term = str_replace( ' ', '+', $q[$t->query_var] );
if ( strpos($term, '+') !== false ) { if ( strpos($term, '+') !== false ) {
$terms = preg_split( '/[+\s]+/', $term ); $terms = preg_split( '/[+]+/', $term );
foreach ( $terms as $term ) { foreach ( $terms as $term ) {
$tax_query[] = array_merge( $tax_query_defaults, array( $tax_query[] = array_merge( $tax_query_defaults, array(
'terms' => array( $term ) 'terms' => array( $term )
@ -1481,7 +1481,7 @@ class WP_Query extends WP_Object_Query {
} }
} else { } else {
$tax_query[] = array_merge( $tax_query_defaults, array( $tax_query[] = array_merge( $tax_query_defaults, array(
'terms' => preg_split('/[,\s]+/', $term) 'terms' => preg_split( '/[,]+/', $term )
) ); ) );
} }
} }