Changeset 16845
- Timestamp:
- 12/09/2010 05:19:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r16843 r16845 512 512 * 513 513 * @param array $tax_query List of taxonomy queries. A single taxonomy query is an associative array: 514 * - 'taxonomy' string |arrayThe taxonomy being queried514 * - 'taxonomy' string The taxonomy being queried 515 515 * - 'terms' string|array The list of terms 516 516 * - 'field' string (optional) Which term field is being used. … … 548 548 extract( $query ); 549 549 550 $taxonomies = (array) $taxonomy; 551 552 foreach ( $taxonomies as $taxonomy ) { 553 if ( ! taxonomy_exists( $taxonomy ) ) 554 return array( 'join' => '', 'where' => ' AND 0 = 1'); 555 } 556 557 $taxonomies = "'" . implode( "', '", $taxonomies ) . "'"; 550 if ( ! taxonomy_exists( $taxonomy ) ) 551 return array( 'join' => '', 'where' => ' AND 0 = 1'); 558 552 559 553 $terms = array_unique( (array) $terms ); … … 563 557 564 558 if ( is_taxonomy_hierarchical( $taxonomy ) && $include_children ) { 565 _transform_terms( $terms, $taxonom ies, $field, 'term_id' );559 _transform_terms( $terms, $taxonomy, $field, 'term_id' ); 566 560 567 561 $children = array(); … … 572 566 $terms = $children; 573 567 574 _transform_terms( $terms, $taxonom ies, 'term_id', 'term_taxonomy_id' );568 _transform_terms( $terms, $taxonomy, 'term_id', 'term_taxonomy_id' ); 575 569 } 576 570 else { 577 _transform_terms( $terms, $taxonom ies, $field, 'term_taxonomy_id' );571 _transform_terms( $terms, $taxonomy, $field, 'term_taxonomy_id' ); 578 572 } 579 573 … … 627 621 628 622 $defaults = array( 629 'taxonomy' => array(),623 'taxonomy' => '', 630 624 'terms' => array(), 631 625 'include_children' => true, … … 644 638 } 645 639 646 function _transform_terms( &$terms, $taxonom ies, $field, $resulting_field ) {640 function _transform_terms( &$terms, $taxonomy, $field, $resulting_field ) { 647 641 global $wpdb; 648 642 … … 663 657 FROM $wpdb->term_taxonomy 664 658 INNER JOIN $wpdb->terms USING (term_id) 665 WHERE taxonomy IN ($taxonomies)659 WHERE taxonomy = '$taxonomy' 666 660 AND $wpdb->terms.$field IN ($terms) 667 661 " ); … … 673 667 SELECT $resulting_field 674 668 FROM $wpdb->term_taxonomy 675 WHERE taxonomy IN ($taxonomies)669 WHERE taxonomy = '$taxonomy' 676 670 AND term_id IN ($terms) 677 671 " );
Note: See TracChangeset
for help on using the changeset viewer.