WordPress.org

Make WordPress Core

Ticket #12729: 12729.diff

File 12729.diff, 715 bytes (added by wonderboymusic, 8 months ago)
  • wp-includes/taxonomy.php

    diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
    index 955369e..aa7798d 100644
    a b function wp_unique_term_slug($slug, $term) { 
    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