wp_insert_term_duplicate_term_check

过滤钩子


apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id )
参数
  • (object)
    $duplicate_term
    Duplicate term row from terms table, if found.
    Required:
  • (string)
    $term
    Term being inserted.
    Required:
  • (string)
    $taxonomy
    Taxonomy name.
    Required:
  • (array)
    $args
    Arguments passed to wp_insert_term().
    Required:
  • (int)
    $tt_id
    term_taxonomy_id for the newly created term.
    Required:
定义位置
  • wp-includes/taxonomy.php
    , line 2554
引入
5.1.0
弃用

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.

$duplicate_term = apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id );