filtrod 5.1.0
wp_insert_term_duplicate_term_check
Opis — z kodu źródłowego
Filters the duplicate term check that takes place during term creation.
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.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$duplicate_term | object | Duplicate term row from terms table, if found. |
$term | string | Term being inserted. |
$taxonomy | string | Taxonomy name. |
$args | array | Arguments passed to wp_insert_term(). |
$tt_id | int | term_taxonomy_id for the newly created term. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_insert_term_duplicate_term_check', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_insert_term_duplicate_term_check', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}Popularne w tej kategorii