Ticket #5809: 5809-2.diff
File 5809-2.diff, 963 bytes (added by , 14 years ago) |
---|
-
wp-includes/taxonomy.php
2270 2270 else 2271 2271 return new WP_Error('duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug)); 2272 2272 } 2273 2274 if( $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy != %s", $id, $taxonomy ) ) ) { 2275 $slug = wp_unique_term_slug( $slug, (object)$args ); 2276 $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ); 2277 $term_id = ( int ) $wpdb->insert_id; 2278 $wpdb->update( $wpdb->term_taxonomy, compact( 'term_id' ), array( 'term_id' => $id, 'taxonomy' => $taxonomy ) ); 2279 } 2280 2273 2281 do_action( 'edit_terms', $term_id ); 2274 2282 $wpdb->update($wpdb->terms, compact( 'name', 'slug', 'term_group' ), compact( 'term_id' ) ); 2275 2283 if ( empty($slug) ) {