get_blog_count()获取站点的总数(多站点)

目录

描述

Get the number of active sites on your installation.

Note: The count is cached and updated twice daily. This is not a live count.

get_blog_count() 描述

用法

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
<?php $blogs = get_blog_count( $id ) ?>

get_blog_count() 用法

参数

$id

(integer) (可选) A site_id

默认值: 0

get_blog_count() 参数

返回值

integer 

The number of active sites

get_blog_count() 返回值

历史

添加于 版本: 1.0

get_blog_count() 历史

源文件

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

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * The number of active sites on your installation.
 *
 * The count is cached and updated twice daily. This is not a live count.
 *
 * @since MU 1.0
 *
 * @param int $network_id Deprecated, not supported.
 * @return int
 */
function get_blog_count( $network_id = 0 ) {
	if ( func_num_args() )
		_deprecated_argument( __FUNCTION__, '3.1' );

	return get_site_option( 'blog_count' );
}

get_blog_count() 源文件