wp_insert_term_duplicate_term_check WordPress Filter Hook

The wp_insert_term_duplicate_term_check hook is used to check if a term already exists before inserting it. This is useful to avoid duplicating terms in the database.

apply_filters( 'wp_insert_term_duplicate_term_check', object $duplicate_term, string $term, string $taxonomy, array $args, int $tt_id ) #

Filters the duplicate term check that takes place during term creation.


Description

Term parent + taxonomy + slug combinations are meant to be unique, and wp_insert_term() performs a last-minute confirmation of this uniqueness before allowing a new term to be created. Plugins with different uniqueness requirements may use this filter to bypass or modify the duplicate-term check.


Top ↑

Parameters

$duplicate_term

(object)Duplicate term row from terms table, if found.

$term

(string)Term being inserted.

$taxonomy

(string)Taxonomy name.

$args

(array)Term arguments passed to the function.

$tt_id

(int)term_taxonomy_id for the newly created term.


Top ↑

Source

File: wp-includes/taxonomy.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More