钩子文档

edit_category_form

💡 云策文档标注

概述

edit_category_form 是一个 WordPress 钩子,在编辑分类表单末尾触发,用于在编辑分类界面执行额外操作,如添加自定义表单字段以保存分类的额外信息。

关键要点

  • 这是一个已弃用的钩子,自 WordPress 3.0.0 起被 {$taxonomy}_add_form 替代。
  • 钩子参数 $argobject 是一个可选参数,被强制转换为对象,可用于传递额外数据。
  • 主要用于扩展编辑分类功能,例如添加自定义字段或执行后端逻辑。

注意事项

由于此钩子已弃用,建议在新开发中使用 {$taxonomy}_add_form 钩子,以确保兼容性和最佳实践。


📄 原文内容

Fires at the end of the Edit Category form.

Parameters

$argobject
Optional arguments cast to an object.

More Information

The edit_category_form 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', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_add_form' );

Changelog

Version Description
3.0.0 Deprecated. Use '{$taxonomy_add_form'} instead.
2.1.0 Introduced.