{$taxonomy}_edit_form
云策文档标注
概述
这是一个 WordPress 动作钩子,在所有分类法的编辑术语表单末尾触发,用于开发者自定义编辑界面。
关键要点
- 钩子名称是动态的,基于分类法 slug,例如 category_edit_form 或 post_tag_edit_form。
- 传递两个参数:$tag(当前分类术语对象,WP_Term 类型)和 $taxonomy(当前分类法 slug,字符串类型)。
- 通过 do_action 调用,允许开发者添加自定义功能到编辑表单。
代码示例
do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );注意事项
- 此钩子自 WordPress 3.0.0 版本引入,确保兼容性。
- 使用时需替换 $taxonomy 为具体分类法 slug 以匹配钩子名称。
原文内容
Fires at the end of the Edit Term form for all taxonomies.
Description
The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
Possible hook names include:
category_edit_formpost_tag_edit_form
Parameters
$tagWP_Term-
Current taxonomy term object.
$taxonomystring-
Current taxonomy slug.
Source
do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |