site_status_persistent_object_cache_notes
云策文档标注
概述
site_status_persistent_object_cache_notes 是一个 WordPress 过滤器,用于修改站点健康检查中关于持久对象缓存建议的描述段落。它允许主机提供商或插件开发者自定义或追加相关说明。
关键要点
- 此过滤器在站点健康检查中,当建议使用持久对象缓存时,过滤描述的第二段落。
- 主机提供商可以用它来推荐其偏好的对象缓存解决方案。
- 插件开发者可以追加(而非替换)关于为何推荐对象缓存的说明。
- 过滤器接受两个参数:$notes(字符串,要追加的说明)和$available_services(字符串数组,可用的持久对象缓存服务列表)。
- 在 WP_Site_Health::get_test_persistent_object_cache() 方法中使用,用于测试站点是否使用持久对象缓存并给出建议。
- 此过滤器自 WordPress 6.1.0 版本引入。
原文内容
Filters the second paragraph of the health check’s description when suggesting the use of a persistent object cache.
Description
Hosts may want to replace the notes to recommend their preferred object caching solution.
Plugin authors may want to append notes (not replace) on why object caching is recommended for their plugin.
Parameters
$notesstring-
The notes appended to the health check description.
$available_servicesstring[]-
The list of available persistent object cache services.
Source
$notes = apply_filters( 'site_status_persistent_object_cache_notes', $notes, $available_services );
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |