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 | |