get_blog_count

The timeline below displays how wordpress function get_blog_count has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Gets the number of active sites on the installation.
 *
 * The count is cached and updated twice daily. This is not a live count.
 *
 * @since MU (3.0.0)
 * @since 3.7.0 The `$network_id` parameter has been deprecated.
 * @since 4.8.0 The `$network_id` parameter is now being used.
 *
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return int Number of active sites on the network.
 */
function get_blog_count($network_id = null)
{
    return get_network_option($network_id, 'blog_count');
}

WordPress Version: 5.1

/**
 * The number of active sites on your installation.
 *
 * The count is cached and updated twice daily. This is not a live count.
 *
 * @since MU (3.0.0)
 * @since 3.7.0 The `$network_id` parameter has been deprecated.
 * @since 4.8.0 The `$network_id` parameter is now being used.
 *
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return int Number of active sites on the network.
 */
function get_blog_count($network_id = null)
{
    return get_network_option($network_id, 'blog_count');
}

WordPress Version: 4.9

/**
 * The number of active sites on your installation.
 *
 * The count is cached and updated twice daily. This is not a live count.
 *
 * @since MU (3.0.0)
 * @since 3.7.0 The $network_id parameter has been deprecated.
 * @since 4.8.0 The $network_id parameter is now being used.
 *
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return int Number of active sites on the network.
 */
function get_blog_count($network_id = null)
{
    return get_network_option($network_id, 'blog_count');
}

WordPress Version: 4.8

/**
 * 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
 * @since 3.7.0 The $network_id parameter has been deprecated.
 * @since 4.8.0 The $network_id parameter is now being used.
 *
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return int Number of active sites on the network.
 */
function get_blog_count($network_id = null)
{
    return get_network_option($network_id, 'blog_count');
}

WordPress Version: 4.6

/**
 * 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.0');
    }
    return get_site_option('blog_count');
}

WordPress Version: 3.7

/**
 * 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');
}