clear_global_post_cache()
云策文档标注
概述
clear_global_post_cache() 是一个已弃用的 WordPress 函数,用于清除全局文章缓存。自 WordPress 3.0.0 版本起,建议使用 clean_post_cache() 替代。
关键要点
- 函数 clear_global_post_cache() 已弃用,不应在新代码中使用。
- 替代函数为 clean_post_cache(),用于清理文章缓存。
- 弃用信息通过 _deprecated_function() 标记,并在使用时通知开发者。
- 参数 $post_id 为必需整数,指定文章 ID。
注意事项
使用此函数会触发弃用警告,建议更新代码以避免兼容性问题。
原文内容
Deprecated functionality to clear the global post cache.
Description
See also
Parameters
$post_idintrequired-
Post ID.
Source
function clear_global_post_cache( $post_id ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'clean_post_cache()' );
}
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Deprecated. Use clean_post_cache() |
| MU (3.0.0) | Introduced. |