Changeset 11457 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 05/25/2009 06:18:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r11450 r11457 1144 1144 1145 1145 foreach ( (array) $objects as $object ) { 1146 $terms = wp_get_object_terms($object, $taxonomy, 'fields=ids');1146 $terms = wp_get_object_terms($object, $taxonomy, array('fields' => 'ids', 'orderby' => 'none')); 1147 1147 if ( 1 == count($terms) && isset($default) ) { 1148 1148 $terms = array($default); … … 1247 1247 else if ( 'term_order' == $orderby ) 1248 1248 $orderby = 'tr.term_order'; 1249 else 1249 else if ( 'none' == $orderby ) { 1250 $orderby = ''; 1251 $order = ''; 1252 } else { 1250 1253 $orderby = 't.term_id'; 1254 } 1255 1256 if ( !empty($orderby) ) 1257 $orderby = "ORDER BY $orderby"; 1251 1258 1252 1259 $taxonomies = "'" . implode("', '", $taxonomies) . "'"; … … 1263 1270 $select_this = 't.*, tt.*, tr.object_id'; 1264 1271 1265 $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) ORDER BY$orderby $order";1272 $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"; 1266 1273 1267 1274 if ( 'all' == $fields || 'all_with_object_id' == $fields ) { … … 1271 1278 $terms = array_merge($terms, $wpdb->get_col($query)); 1272 1279 } else if ( 'tt_ids' == $fields ) { 1273 $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) ORDER BY tr.term_taxonomy_id $order"); 1280 if ( !empty($order_by) ) 1281 $orderby = "ORDER BY tr.term_taxonomy_id"; 1282 $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"); 1274 1283 } 1275 1284 … … 1445 1454 1446 1455 if ( ! $append ) 1447 $old_tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');1456 $old_tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids', 'orderby' => 'none')); 1448 1457 1449 1458 $tt_ids = array();
Note: See TracChangeset
for help on using the changeset viewer.