quick_edit_enabled_for_post_type
云策文档标注
概述
quick_edit_enabled_for_post_type 是一个 WordPress 过滤器,用于控制是否对特定文章类型启用快速编辑功能。开发者可以通过此过滤器自定义快速编辑的启用状态。
关键要点
- 过滤器名称:quick_edit_enabled_for_post_type
- 参数:$enable(布尔值,默认 true)和 $post_type(字符串,文章类型名称)
- 用途:允许开发者基于文章类型动态启用或禁用快速编辑功能
- 相关函数:在 WP_Posts_List_Table 类中用于处理行操作和标题列输出
- 引入版本:WordPress 6.4.0
代码示例
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_post_type', true, $post->post_type );
原文内容
Filters whether Quick Edit should be enabled for the given post type.
Parameters
$enablebool-
Whether to enable the Quick Edit functionality. Default true.
$post_typestring-
Post type name.
Source
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_post_type', true, $post->post_type );
Changelog
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |