钩子文档

edit_tag_form_fields

💡 云策文档标注

概述

edit_tag_form_fields 是一个 WordPress 动作钩子,在编辑标签表单字段显示后触发,用于开发者添加自定义内容或逻辑。该钩子自 3.0.0 版本起已被弃用,建议使用替代钩子。

关键要点

  • 触发时机:在编辑标签表单字段显示后执行。
  • 参数:$tag,类型为 WP_Term,表示当前标签的术语对象。
  • 弃用状态:自 WordPress 3.0.0 起弃用,推荐使用 {$taxonomy}_edit_form_fields 钩子替代。
  • 历史版本:2.9.0 版本引入,3.0.0 版本弃用。

注意事项

由于此钩子已弃用,新开发应避免使用,转而使用 {$taxonomy}_edit_form_fields 钩子以确保兼容性和最佳实践。


📄 原文内容

Fires after the Edit Tag form fields are displayed.

Parameters

$tagWP_Term
Current tag term object.

Source

do_action_deprecated( 'edit_tag_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' );

Changelog

Version Description
3.0.0 Deprecated. Use '{$taxonomy_edit_form_fields'} instead.
2.9.0 Introduced.