wp_insert_term_duplicate_term_check

wp_insert_term_duplicate_term_check

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.1

apply_filters('wp_insert_term_duplicate_term_check') is found 1 times:

  • /wp-includes/taxonomy.php line 2630
    	 * @param string $taxonomy       Taxonomy name.
    	 * @param array  $args           Arguments passed to wp_insert_term().
    	 * @param int    $tt_id          term_taxonomy_id for the newly created term.
    	 */
    	$duplicate_term = apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id );
    
    	if ( $duplicate_term ) {
    		$wpdb->delete( $wpdb->terms, array( 'term_id' => $term_id ) );
    		$wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $tt_id ) );
    
    		$term_id = (int) $duplicate_term->term_id;