Ticket #15741: 15741.4.diff
| File 15741.4.diff, 1.3 KB (added by , 12 years ago) |
|---|
-
wp-includes/taxonomy.php
2093 2093 // Hierarchical, and it matches an existing term, Do not allow same "name" in the same level. 2094 2094 $siblings = get_terms($taxonomy, array('fields' => 'names', 'get' => 'all', 'parent' => (int)$parent) ); 2095 2095 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']); 2097 2097 } else { 2098 2098 $slug = wp_unique_term_slug($slug, (object) $args); 2099 2099 if ( false === $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ) ) … … 2108 2108 $term_id = (int) $wpdb->insert_id; 2109 2109 } elseif ( $exists = term_exists( (int) $term_id, $taxonomy ) ) { 2110 2110 // 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']); 2112 2112 } 2113 2113 } else { 2114 2114 // This term does not exist at all in the database, Create it.