clean_blog_cache()
clean_blog_cache( WP_Site|int $blog ) 清除博客缓存Clean the b…
clean_blog_cache( WP_Site|int $blog )
清除博客缓存
Clean the blog cache
目录锚点:#参数#返回#源码
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $blog | (WP_Site | int) | 必需 | 要从缓存中清除的站点对象或ID。 |
返回(Return)
无返回值
源码(Source)
/**
* Clean the blog cache
*
* @since 3.5.0
*
* @param stdClass $blog The blog details as returned from get_blog_details()
*/
function clean_blog_cache( $blog ) {
$blog_id = $blog->blog_id;
$domain_path_key = md5( $blog->domain . $blog->path );
wp_cache_delete( $blog_id , 'blog-details' );
wp_cache_delete( $blog_id . 'short' , 'blog-details' );
wp_cache_delete( $domain_path_key, 'blog-lookup' );
wp_cache_delete( 'current_blog_' . $blog->domain, 'site-options' );
wp_cache_delete( 'current_blog_' . $blog->domain . $blog->path, 'site-options' );
wp_cache_delete( 'get_id_from_blogname_' . trim( $blog->path, '/' ), 'blog-details' );
wp_cache_delete( $domain_path_key, 'blog-id-cache' );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.5.0 | wp-includes/ms-site.php:972 | 7 | 8 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!