Ticket #11003: 11003.diff
File 11003.diff, 1.7 KB (added by , 15 years ago) |
---|
-
wp-includes/taxonomy.php
1283 1283 else if ( 'all_with_object_id' == $fields ) 1284 1284 $select_this = 't.*, tt.*, tr.object_id'; 1285 1285 1286 $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";1286 $query = "SELECT DISTINCT $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"; 1287 1287 1288 1288 if ( 'all' == $fields || 'all_with_object_id' == $fields ) { 1289 1289 $terms = array_merge($terms, $wpdb->get_results($query)); … … 1291 1291 } else if ( 'ids' == $fields || 'names' == $fields ) { 1292 1292 $terms = array_merge($terms, $wpdb->get_col($query)); 1293 1293 } else if ( 'tt_ids' == $fields ) { 1294 $terms = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) $orderby $order");1294 $terms = $wpdb->get_col("SELECT DISTINCT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) $orderby $order"); 1295 1295 } 1296 1296 1297 1297 if ( ! $terms )