clean_blog_cache()清除博客缓存

目录

描述

Cleans the cache objects of the blog.

clean_blog_cache() 描述

用法

<?php clean_blog_cache$blog ); ?>

clean_blog_cache() 用法

参数

$blog

(Object) (必填) The blog details as returned from get_blog_details()

默认值: None

clean_blog_cache() 参数

历史

clean_blog_cache() 历史

源文件

clean_blog_cache() 函数的代码位于 wp-includes/ms-blogs.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * 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' );
}

clean_blog_cache() 源文件