refresh_blog_details()
云策文档标注
概述
refresh_blog_details() 函数用于清除博客详情缓存,适用于多站点环境。它接受一个可选的博客ID参数,默认处理当前博客。
关键要点
- 函数功能:清除指定博客的详情缓存,通过调用 clean_blog_cache() 实现。
- 参数说明:$blog_id 为可选整数参数,默认为0,表示当前博客ID;函数内部会使用 get_current_blog_id() 获取当前博客ID。
- 相关函数:与 clean_blog_cache() 和 get_current_blog_id() 关联,用于缓存清理和ID获取。
- 版本历史:自 WordPress MU 3.0.0 版本引入。
原文内容
Clears the blog details cache.
Parameters
$blog_idintoptional-
Blog ID. Defaults to current blog.
Source
function refresh_blog_details( $blog_id = 0 ) {
$blog_id = (int) $blog_id;
if ( ! $blog_id ) {
$blog_id = get_current_blog_id();
}
clean_blog_cache( $blog_id );
}
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |