Make WordPress Core

Ticket #12729: 12729.2.diff

File 12729.2.diff, 715 bytes (added by wonderboymusic, 11 years ago)
  • src/wp-includes/taxonomy.php

     
    23802380        }
    23812381
    23822382        // If we didn't get a unique slug, try appending a number to make it unique.
    2383         if ( !empty($args['term_id']) )
    2384                 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $args['term_id'] );
     2383        if ( ! empty( $term->term_id ) )
     2384                $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $term->term_id );
    23852385        else
    23862386                $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug );
    23872387