钩子文档

split_shared_term

💡 云策文档标注

概述

split_shared_term 是一个 WordPress 动作钩子,在共享的分类法术语被拆分为两个独立术语后触发。它主要用于处理术语拆分后的相关操作。

关键要点

  • 触发时机:当之前共享的分类法术语被拆分为两个独立术语时触发。
  • 参数说明:$term_id(原共享术语的 ID)、$new_term_id(为新术语创建的 ID)、$term_taxonomy_id(受拆分影响的 term_taxonomy 行 ID)、$taxonomy(拆分术语的分类法名称)。
  • 源调用:do_action( 'split_shared_term', $term_id, $new_term_id, $term_taxonomy_id, $term_taxonomy->taxonomy )。
  • 版本历史:从 WordPress 4.2.0 版本开始引入。

📄 原文内容

Fires after a previously shared taxonomy term is split into two separate terms.

Parameters

$term_idint
ID of the formerly shared term.
$new_term_idint
ID of the new term created for the $term_taxonomy_id.
$term_taxonomy_idint
ID for the term_taxonomy row affected by the split.
$taxonomystring
Taxonomy for the split term.

Source

do_action( 'split_shared_term', $term_id, $new_term_id, $term_taxonomy_id, $term_taxonomy->taxonomy );

Changelog

Version Description
4.2.0 Introduced.