Changeset 16843 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 12/09/2010 05:05:40 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r16837 r16843 534 534 $i = 0; 535 535 536 if ( isset( $tax_query['relation'] ) && strtoupper( $tax_query['relation'] ) == 'OR' ) { 536 _set_tax_query_defaults( $tax_query ); 537 538 if ( strtoupper( $tax_query['relation'] ) == 'OR' ) { 537 539 $relation = 'OR'; 538 540 } else { … … 544 546 continue; 545 547 546 extract( wp_parse_args( $query, array( 547 'taxonomy' => array(), 548 'terms' => array(), 549 'include_children' => true, 550 'field' => 'term_id', 551 'operator' => 'IN', 552 ) ) ); 548 extract( $query ); 553 549 554 550 $taxonomies = (array) $taxonomy; … … 624 620 625 621 return compact( 'join', 'where' ); 622 } 623 624 function _set_tax_query_defaults( &$tax_query ) { 625 if ( ! isset( $tax_query['relation'] ) ) 626 $tax_query['relation'] = 'AND'; 627 628 $defaults = array( 629 'taxonomy' => array(), 630 'terms' => array(), 631 'include_children' => true, 632 'field' => 'term_id', 633 'operator' => 'IN', 634 ); 635 636 foreach ( $tax_query as $i => $query ) { 637 if ( ! is_array( $query ) ) 638 continue; 639 640 $tax_query[$i] = array_merge( $defaults, $query ); 641 642 $tax_query[$i]['terms'] = (array) $tax_query[$i]['terms']; 643 } 626 644 } 627 645
Note: See TracChangeset
for help on using the changeset viewer.