refresh_blog_details() - WordPress 函数参考中文文档

返回介绍

refresh_blog_details()

发布于 2017-09-11 字数1898 浏览 1044 评论 0

refresh_blog_details( int $blog_id )

Clear the blog details cache.


描述


参数

$blog_id

(int)
(Optional)
Blog ID. Defaults to current blog.


源代码

File: wp-includes/ms-blogs.php

function refresh_blog_details( $blog_id = 0 ) {
	$blog_id = (int) $blog_id;
	if ( ! $blog_id ) {
		$blog_id = get_current_blog_id();
	}

	$details = get_site( $blog_id );
	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 );
}

更新日志

Version 描述
MU Introduced.

相关函数

Uses

  • wp-includes/ms-blogs.php:
    get_site()
  • wp-includes/load.php:
    get_current_blog_id()
  • wp-includes/plugin.php:
    do_action()
  • wp-includes/ms-blogs.php:
    clean_blog_cache()
  • wp-includes/ms-blogs.php:
    refresh_blog_details

Used By

  • wp-includes/ms-functions.php:
    insert_blog()
  • wp-includes/ms-blogs.php:
    update_blog_status()
  • wp-includes/ms-blogs.php:
    update_blog_details()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!