Ticket #15363: dont-ignore-tax-parameters.15363.diff
File dont-ignore-tax-parameters.15363.diff, 1.8 KB (added by , 13 years ago) |
---|
-
wp-includes/query.php
1472 1472 'field' => 'slug', 1473 1473 'operator' => 'IN', 1474 1474 ); 1475 } else { 1476 foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { 1477 if ( $t->query_var && !empty( $q[$t->query_var] ) ) { 1478 $tax_query_defaults = array( 1479 'taxonomy' => $taxonomy, 1480 'field' => 'slug', 1481 'operator' => 'IN' 1482 ); 1475 } 1483 1476 1484 if ( $t->rewrite['hierarchical'] ) { 1485 $q[$t->query_var] = wp_basename( $q[$t->query_var] ); 1486 } 1477 foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { 1478 if ( $t->query_var && !empty( $q[$t->query_var] ) ) { 1479 $tax_query_defaults = array( 1480 'taxonomy' => $taxonomy, 1481 'field' => 'slug', 1482 'operator' => 'IN' 1483 ); 1487 1484 1488 $term = str_replace( ' ', '+', $q[$t->query_var] ); 1485 if ( $t->rewrite['hierarchical'] ) { 1486 $q[$t->query_var] = wp_basename( $q[$t->query_var] ); 1487 } 1489 1488 1490 if ( strpos($term, '+') !== false ) { 1491 $terms = preg_split( '/[+]+/', $term ); 1492 foreach ( $terms as $term ) { 1493 $tax_query[] = array_merge( $tax_query_defaults, array( 1494 'terms' => array( $term ) 1495 ) ); 1496 } 1497 } else { 1489 $term = str_replace( ' ', '+', $q[$t->query_var] ); 1490 1491 if ( strpos($term, '+') !== false ) { 1492 $terms = preg_split( '/[+]+/', $term ); 1493 foreach ( $terms as $term ) { 1498 1494 $tax_query[] = array_merge( $tax_query_defaults, array( 1499 'terms' => preg_split( '/[,]+/',$term )1495 'terms' => array( $term ) 1500 1496 ) ); 1501 1497 } 1498 } else { 1499 $tax_query[] = array_merge( $tax_query_defaults, array( 1500 'terms' => preg_split( '/[,]+/', $term ) 1501 ) ); 1502 1502 } 1503 1503 } 1504 1504 }