Ticket #6211: same-slug-diff-taxonomy.patch
| File same-slug-diff-taxonomy.patch, 858 bytes (added by nerrad, 5 years ago) |
|---|
-
wp-includes/taxonomy.php
1151 1151 } 1152 1152 } 1153 1153 1154 if ( ! $term_id = is_term($slug ) ) {1154 if ( ! $term_id = is_term($slug, $taxonomy) ) { 1155 1155 $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ); 1156 1156 $term_id = (int) $wpdb->insert_id; 1157 1157 } else if ( is_taxonomy_hierarchical($taxonomy) && !empty($parent) ) { … … 1161 1161 $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ); 1162 1162 $term_id = (int) $wpdb->insert_id; 1163 1163 } 1164 1164 1165 if ( is_array($term_id) ) 1166 $term_id = $term_id['term_id']; 1167 1165 1168 if ( empty($slug) ) { 1166 1169 $slug = sanitize_title($slug, $term_id); 1167 1170 $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );