Make WordPress Core

Ticket #15741: 15741.4.diff

File 15741.4.diff, 1.3 KB (added by SergeyBiryukov, 12 years ago)
  • wp-includes/taxonomy.php

     
    20932093                        // Hierarchical, and it matches an existing term, Do not allow same "name" in the same level.
    20942094                        $siblings = get_terms($taxonomy, array('fields' => 'names', 'get' => 'all', 'parent' => (int)$parent) );
    20952095                        if ( in_array($name, $siblings) ) {
    2096                                 return new WP_Error('term_exists', __('A term with the name provided already exists with this parent.'), $exists['term_id']);
     2096                                return new WP_Error('term_exists', __('A term with the name and slug provided already exists with this parent.'), $exists['term_id']);
    20972097                        } else {
    20982098                                $slug = wp_unique_term_slug($slug, (object) $args);
    20992099                                if ( false === $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ) )
     
    21082108                        $term_id = (int) $wpdb->insert_id;
    21092109                } elseif ( $exists = term_exists( (int) $term_id, $taxonomy ) )  {
    21102110                        // Same name, same slug.
    2111                         return new WP_Error('term_exists', __('A term with the name provided already exists.'), $exists['term_id']);
     2111                        return new WP_Error('term_exists', __('A term with the name and slug provided already exists.'), $exists['term_id']);
    21122112                }
    21132113        } else {
    21142114                // This term does not exist at all in the database, Create it.