Changeset 28423
- Timestamp:
- 05/15/2014 05:42:55 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r28422 r28423 577 577 global $wpdb; 578 578 579 if ( ! is_array( $term_ids ) ) 579 if ( ! is_array( $term_ids ) ) { 580 580 $term_ids = array( $term_ids ); 581 582 if ( ! is_array( $taxonomies ) ) 581 } 582 if ( ! is_array( $taxonomies ) ) { 583 583 $taxonomies = array( $taxonomies ); 584 584 } 585 585 foreach ( (array) $taxonomies as $taxonomy ) { 586 if ( ! taxonomy_exists( $taxonomy ) ) 586 if ( ! taxonomy_exists( $taxonomy ) ) { 587 587 return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) ); 588 } 588 589 } 589 590 590 591 $defaults = array( 'order' => 'ASC' ); 591 592 $args = wp_parse_args( $args, $defaults ); 592 extract( $args, EXTR_SKIP ); 593 594 $order = ( 'desc' == strtolower( $order ) ) ? 'DESC' : 'ASC'; 593 594 $order = ( 'desc' == strtolower( $args['order'] ) ) ? 'DESC' : 'ASC'; 595 595 596 596 $term_ids = array_map('intval', $term_ids ); … … 601 601 $object_ids = $wpdb->get_col("SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($term_ids) ORDER BY tr.object_id $order"); 602 602 603 if ( ! $object_ids ) 603 if ( ! $object_ids ){ 604 604 return array(); 605 605 } 606 606 return $object_ids; 607 607 }
Note: See TracChangeset
for help on using the changeset viewer.