Changeset 15860 for trunk/wp-includes/query.php
- Timestamp:
- 10/20/2010 12:07:23 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r15850 r15860 1453 1453 $tax_query[] = array( 1454 1454 'taxonomy' => $q['taxonomy'], 1455 'terms' => $q['term'], 1455 'terms' => array( $q['term'] ), 1456 'field' => 'slug', 1456 1457 ); 1457 } 1458 1459 foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { 1460 if ( $t->query_var && !empty( $q[$t->query_var] ) ) { 1461 $tax_query_defaults = array( 1462 'taxonomy' => $taxonomy, 1463 'field' => 'slug', 1464 'operator' => 'IN' 1465 ); 1466 1467 if ( $t->rewrite['hierarchical'] ) { 1468 $q[$t->query_var] = basename($q[$t->query_var]); 1469 if ( $taxonomy == $q['taxonomy'] ) 1470 $q['term'] = basename($q['term']); 1471 } 1472 1473 $term = $q[$t->query_var]; 1474 1475 if ( strpos($term, '+') !== false ) { 1476 $terms = preg_split( '/[+\s]+/', $term ); 1477 foreach ( $terms as $term ) { 1458 } else { 1459 foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { 1460 if ( $t->query_var && !empty( $q[$t->query_var] ) ) { 1461 $tax_query_defaults = array( 1462 'taxonomy' => $taxonomy, 1463 'field' => 'slug', 1464 'operator' => 'IN' 1465 ); 1466 1467 if ( $t->rewrite['hierarchical'] ) { 1468 $q[$t->query_var] = basename($q[$t->query_var]); 1469 if ( $taxonomy == $q['taxonomy'] ) 1470 $q['term'] = basename($q['term']); 1471 } 1472 1473 $term = $q[$t->query_var]; 1474 1475 if ( strpos($term, '+') !== false ) { 1476 $terms = preg_split( '/[+\s]+/', $term ); 1477 foreach ( $terms as $term ) { 1478 $tax_query[] = array_merge( $tax_query_defaults, array( 1479 'terms' => array( $term ) 1480 ) ); 1481 } 1482 } else { 1478 1483 $tax_query[] = array_merge( $tax_query_defaults, array( 1479 'terms' => array( $term)1484 'terms' => preg_split('/[,\s]+/', $term) 1480 1485 ) ); 1481 1486 } 1482 } else {1483 $tax_query[] = array_merge( $tax_query_defaults, array(1484 'terms' => preg_split('/[,\s]+/', $term)1485 ) );1486 1487 } 1487 1488 }
Note: See TracChangeset
for help on using the changeset viewer.