quick_edit_enabled_for_taxonomy
云策文档标注
概述
该文档介绍了 WordPress 中的一个过滤器钩子 quick_edit_enabled_for_taxonomy,用于控制是否对指定分类法启用快速编辑功能。开发者可以通过此钩子自定义快速编辑的启用状态。
关键要点
- 过滤器钩子:quick_edit_enabled_for_taxonomy,用于过滤是否启用分类法的快速编辑功能。
- 参数:$enable(布尔值,默认为 true)表示是否启用;$taxonomy(字符串)表示分类法名称。
- 用法示例:通过 apply_filters 调用,如 apply_filters( 'quick_edit_enabled_for_taxonomy', true, $taxonomy )。
- 相关函数:WP_Terms_List_Table::handle_row_actions() 和 WP_Terms_List_Table::column_name() 使用此钩子。
- 版本信息:自 WordPress 6.4.0 版本引入。
代码示例
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_taxonomy', true, $taxonomy );
原文内容
Filters whether Quick Edit should be enabled for the given taxonomy.
Parameters
$enablebool-
Whether to enable the Quick Edit functionality. Default true.
$taxonomystring-
Taxonomy name.
Source
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_taxonomy', true, $taxonomy );
Changelog
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |