Changeset 26544
- Timestamp:
- 12/02/2013 11:05:49 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/taxonomy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r26510 r26544 2144 2144 $description = wp_unslash($description); 2145 2145 2146 if ( empty($slug) ) 2146 $slug_provided = ! empty( $slug ); 2147 if ( ! $slug_provided ) { 2147 2148 $slug = sanitize_title($name); 2149 } 2148 2150 2149 2151 $term_group = 0; … … 2169 2171 $siblings = get_terms($taxonomy, array('fields' => 'names', 'get' => 'all', 'parent' => (int)$parent) ); 2170 2172 if ( in_array($name, $siblings) ) { 2171 return new WP_Error('term_exists', __('A term with the name provided already exists with this parent.'), $exists['term_id']); 2173 if ( $slug_provided ) { 2174 return new WP_Error( 'term_exists', __( 'A term with the name and slug provided already exists with this parent.' ), $exists['term_id'] ); 2175 } else { 2176 return new WP_Error( 'term_exists', __( 'A term with the name provided already exists with this parent.' ), $exists['term_id'] ); 2177 } 2172 2178 } else { 2173 2179 $slug = wp_unique_term_slug($slug, (object) $args); … … 2184 2190 } elseif ( $exists = term_exists( (int) $term_id, $taxonomy ) ) { 2185 2191 // Same name, same slug. 2186 return new WP_Error( 'term_exists', __('A term with the name provided already exists.'), $exists['term_id']);2192 return new WP_Error( 'term_exists', __( 'A term with the name and slug provided already exists.' ), $exists['term_id'] ); 2187 2193 } 2188 2194 } else {
Note: See TracChangeset
for help on using the changeset viewer.