钩子文档

edit_category_form_fields

💡 云策文档标注

概述

edit_category_form_fields 是一个 WordPress 动作钩子,在编辑分类表单字段显示后触发,主要用于在编辑分类界面执行额外操作,例如添加自定义表单字段以保存分类的附加信息。

关键要点

  • 这是一个已弃用的钩子,自 WordPress 3.0.0 起被 {$taxonomy}_edit_form_fields 替代。
  • 钩子参数为 $tag,类型为 WP_Term,表示当前分类的术语对象。
  • 适用于在编辑分类屏幕中添加自定义表单字段或执行其他后端逻辑。

注意事项

由于此钩子已弃用,建议在新开发中使用 {$taxonomy}_edit_form_fields 钩子,以确保代码的兼容性和未来维护性。


📄 原文内容

Fires after the Edit Category form fields are displayed.

Parameters

$tagWP_Term
Current category term object.

More Information

The edit_category_form_fields action/hook can be used to perform additional actions on the edit category screen. For example, you can add form fields in order to save additional information for a particular category.

Source

do_action_deprecated( 'edit_category_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.