Changeset 6326 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 11/09/2007 06:34:41 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r6321 r6326 1207 1207 1208 1208 // If we didn't get a unique slug, try appending a number to make it unique. 1209 if ( $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) { 1209 if ( !empty($args['term_id']) ) 1210 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $args['term_id'] ); 1211 else 1212 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s $where", $slug ); 1213 1214 if ( $wpdb->get_var( $query ) ) { 1210 1215 $num = 2; 1211 1216 do { … … 1282 1287 $id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE slug = %s", $slug ) ); 1283 1288 if ( $id && ($id != $term_id) ) { 1284 // If an empty slug was passed , reset the slug to something unique.1289 // If an empty slug was passed or the parent changed, reset the slug to something unique. 1285 1290 // Otherwise, bail. 1286 if ( $empty_slug )1291 if ( $empty_slug || ( $parent != $term->parent) ) 1287 1292 $slug = wp_unique_term_slug($slug, (object) $args); 1288 1293 else
Note: See TracChangeset
for help on using the changeset viewer.