refresh_blog_details()

清除博客详细信息缓存。

refresh_blog_details(int $blog_id)

参数(Parameters)

参数类型必填说明
$blog_id(int)可选博客ID。默认为当前博客。

返回(Return)

无返回值


源码(Source)

/**
 * Clear the blog details cache.
 *
 * @since MU
 *
 * @param int $blog_id Optional. Blog ID. Defaults to current blog.
 */
function refresh_blog_details( $blog_id = 0 ) {
	$blog_id = (int) $blog_id;
	if ( ! $blog_id ) {
		$blog_id = get_current_blog_id();
	}
 
	$details = get_blog_details( $blog_id, false );
	if ( ! $details ) {
		// Make sure clean_blog_cache() gets the blog ID
		// when the blog has been previously cached as
		// non-existent.
		$details = (object) array(
			'blog_id' => $blog_id,
			'domain' => null,
			'path' => null
		);
	}
 
	clean_blog_cache( $details );
 
	/**
	 * Fires after the blog details cache is cleared.
	 *
	 * @since 3.4.0
	 *
	 * @param int $blog_id Blog ID.
	 */
	do_action( 'refresh_blog_details', $blog_id );
}
更新版本源码位置使用被使用
MU (3.0.0)wp-includes/ms-blogs.php:27302
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索