Ticket #5857: 5857.diff
| File 5857.diff, 1.8 KB (added by , 18 years ago) |
|---|
-
wp-includes/taxonomy.php
1033 1033 $orderby = 't.slug'; 1034 1034 else if ( 'term_group' == $orderby ) 1035 1035 $orderby = 't.term_group'; 1036 else if ( 'term_order' == $orderby ) 1037 $orderby = 'tr.term_order'; 1036 1038 else 1037 1039 $orderby = 't.term_id'; 1038 1040 … … 1249 1251 } 1250 1252 } 1251 1253 1254 $t = get_taxonomy($taxonomy); 1255 if ( ! $append && $t->sort ) { 1256 $values = array(); 1257 $term_order = 0; 1258 $final_term_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids'); 1259 foreach ( $term_ids as $term_id ) 1260 if ( in_array($term_id, $final_term_ids) ) 1261 $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $term_id, ++$term_order); 1262 if ( $values ) 1263 $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); 1264 } 1265 1252 1266 return $tt_ids; 1253 1267 } 1254 1268 -
wp-includes/version.php
16 16 * 17 17 * @global int $wp_db_version 18 18 */ 19 $wp_db_version = 68 25;19 $wp_db_version = 6846; 20 20 21 21 ?> -
wp-admin/includes/schema.php
31 31 CREATE TABLE $wpdb->term_relationships ( 32 32 object_id bigint(20) NOT NULL default 0, 33 33 term_taxonomy_id bigint(20) NOT NULL default 0, 34 term_order int(11) NOT NULL default 0, 34 35 PRIMARY KEY (object_id,term_taxonomy_id), 35 36 KEY term_taxonomy_id (term_taxonomy_id) 36 37 ) $charset_collate;