Changeset 29119
- Timestamp:
- 07/12/2014 03:53:34 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r28976 r29119 2322 2322 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tr.object_id IN ($object_ids) $orderby $order"; 2323 2323 2324 $objects = false; 2324 2325 if ( 'all' == $fields || 'all_with_object_id' == $fields ) { 2325 2326 $_terms = $wpdb->get_results( $query ); … … 2329 2330 $terms = array_merge( $terms, $_terms ); 2330 2331 update_term_cache( $terms ); 2332 $objects = true; 2331 2333 } else if ( 'ids' == $fields || 'names' == $fields || 'slugs' == $fields ) { 2332 2334 $_terms = $wpdb->get_col( $query ); … … 2345 2347 if ( ! $terms ) { 2346 2348 $terms = array(); 2347 } else { 2348 $terms = array_values( array_unique( $terms, SORT_REGULAR ) ); 2349 } elseif ( $objects && 'all_with_object_id' !== $fields ) { 2350 $_tt_ids = array(); 2351 $_terms = array(); 2352 foreach ( $terms as $term ) { 2353 if ( in_array( $term->term_taxonomy_id, $_tt_ids ) ) { 2354 continue; 2355 } 2356 2357 $_tt_ids[] = $term->term_taxonomy_id; 2358 $_terms[] = $term; 2359 } 2360 $terms = $_terms; 2361 } elseif ( ! $objects ) { 2362 $terms = array_values( array_unique( $terms ) ); 2349 2363 } 2350 2364 /**
Note: See TracChangeset
for help on using the changeset viewer.