contextual_help_list
云策文档标注
概述
本文档介绍 WordPress 中已弃用的 'contextual_help_list' 过滤器,用于过滤旧版上下文帮助列表。自 WordPress 3.3.0 起,建议使用 WP_Screen 类的新方法替代。
关键要点
- 'contextual_help_list' 是一个已弃用的过滤器,用于修改旧版上下文帮助内容。
- 该过滤器有两个参数:$old_compat_help(旧帮助数组)和 $screen(当前 WP_Screen 实例)。
- 自 WordPress 3.3.0 起,推荐使用 get_current_screen()->add_help_tab() 或 get_current_screen()->remove_help_tab() 来管理帮助标签。
- 该过滤器在 WP_Screen::render_screen_meta() 方法中被调用,用于渲染屏幕帮助部分。
注意事项
由于此过滤器已弃用,开发者应避免在新代码中使用,并迁移到 WP_Screen 类的新 API 以确保兼容性和最佳实践。
原文内容
Filters the legacy contextual help list.
Parameters
Source
self::$_old_compat_help = apply_filters_deprecated(
'contextual_help_list',
array( self::$_old_compat_help, $this ),
'3.3.0',
'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
);
Changelog
| Version | Description |
|---|---|
| 3.3.0 | Deprecated. Use get_current_screen()->add_help_tab() or get_current_screen()->remove_help_tab() instead. |
| 2.7.0 | Introduced. |