Changeset 43570
- Timestamp:
- 08/15/2018 07:49:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r43558 r43570 2313 2313 * are not fired. 2314 2314 */ 2315 $duplicate_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.term_id, tt.term_taxonomy_id FROM $wpdb->terms t INNER JOIN $wpdb->term_taxonomy tt ON ( tt.term_id = t.term_id ) WHERE t.slug = %s AND tt.parent = %d AND tt.taxonomy = %s AND t.term_id < %d AND tt.term_taxonomy_id != %d", $slug, $parent, $taxonomy, $term_id, $tt_id ) ); 2315 $duplicate_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.term_id, t.slug, tt.term_taxonomy_id, tt.taxonomy FROM $wpdb->terms t INNER JOIN $wpdb->term_taxonomy tt ON ( tt.term_id = t.term_id ) WHERE t.slug = %s AND tt.parent = %d AND tt.taxonomy = %s AND t.term_id < %d AND tt.term_taxonomy_id != %d", $slug, $parent, $taxonomy, $term_id, $tt_id ) ); 2316 2317 /** 2318 * Filters the duplicate term check that takes place during term creation. 2319 * 2320 * Term parent+taxonomy+slug combinations are meant to be unique, and wp_insert_term() 2321 * performs a last-minute confirmation of this uniqueness before allowing a new term 2322 * to be created. Plugins with different uniqueness requirements may use this filter 2323 * to bypass or modify the duplicate-term check. 2324 * 2325 * @since 5.0.0 2326 * 2327 * @param object $duplicate_term Duplicate term row from terms table, if found. 2328 * @param string $term Term being inserted. 2329 * @param string $taxonomy Taxonomy name. 2330 * @param array $args Term arguments passed to the function. 2331 * @param int $tt_id term_taxonomy_id for the newly created term. 2332 */ 2333 $duplicate_term = apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id ); 2334 2316 2335 if ( $duplicate_term ) { 2317 2336 $wpdb->delete( $wpdb->terms, array( 'term_id' => $term_id ) );
Note: See TracChangeset
for help on using the changeset viewer.