WordPress.org

Make WordPress Core

Ticket #24216: 24216.diff

File 24216.diff, 687 bytes (added by Sebastian Klier, 13 months ago)
  • wp-includes/taxonomy.php

    diff --git wp-includes/taxonomy.php wp-includes/taxonomy.php
    index 64a38ea..7ebb3ed 100644
    function wp_unique_term_slug($slug, $term) { 
    23772377        } 
    23782378 
    23792379        // If we didn't get a unique slug, try appending a number to make it unique. 
    2380         if ( !empty($args['term_id']) ) 
    2381                 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $args['term_id'] ); 
    2382         else 
    2383                 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug ); 
     2380        $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug ); 
    23842381 
    23852382        if ( $wpdb->get_var( $query ) ) { 
    23862383                $num = 2;