wp_is_large_network

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

WordPress Version: 6.2

/**
 * Determines whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter.
 *
 * @since 3.3.0
 * @since 4.8.0 The `$network_id` parameter has been added.
 *
 * @param string   $using      'sites' or 'users'. Default is 'sites'.
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites', $network_id = null)
{
    $network_id = (int) $network_id;
    if (!$network_id) {
        $network_id = get_current_network_id();
    }
    if ('users' === $using) {
        $count = get_user_count($network_id);
        $is_large_network = wp_is_large_user_count($network_id);
        /**
         * Filters whether the network is considered large.
         *
         * @since 3.3.0
         * @since 4.8.0 The `$network_id` parameter has been added.
         *
         * @param bool   $is_large_network Whether the network has more than 10000 users or sites.
         * @param string $component        The component to count. Accepts 'users', or 'sites'.
         * @param int    $count            The count of items for the component.
         * @param int    $network_id       The ID of the network being checked.
         */
        return apply_filters('wp_is_large_network', $is_large_network, 'users', $count, $network_id);
    }
    $count = get_blog_count($network_id);
    /** This filter is documented in wp-includes/ms-functions.php */
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count, $network_id);
}

WordPress Version: 6.1

/**
 * Determines whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter.
 *
 * @since 3.3.0
 * @since 4.8.0 The `$network_id` parameter has been added.
 *
 * @param string   $using      'sites or 'users'. Default is 'sites'.
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites', $network_id = null)
{
    $network_id = (int) $network_id;
    if (!$network_id) {
        $network_id = get_current_network_id();
    }
    if ('users' === $using) {
        $count = get_user_count($network_id);
        $is_large_network = wp_is_large_user_count($network_id);
        /**
         * Filters whether the network is considered large.
         *
         * @since 3.3.0
         * @since 4.8.0 The `$network_id` parameter has been added.
         *
         * @param bool   $is_large_network Whether the network has more than 10000 users or sites.
         * @param string $component        The component to count. Accepts 'users', or 'sites'.
         * @param int    $count            The count of items for the component.
         * @param int    $network_id       The ID of the network being checked.
         */
        return apply_filters('wp_is_large_network', $is_large_network, 'users', $count, $network_id);
    }
    $count = get_blog_count($network_id);
    /** This filter is documented in wp-includes/ms-functions.php */
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count, $network_id);
}

WordPress Version: 5.5

/**
 * Whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter.
 *
 * @since 3.3.0
 * @since 4.8.0 The `$network_id` parameter has been added.
 *
 * @param string   $using      'sites or 'users'. Default is 'sites'.
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites', $network_id = null)
{
    $network_id = (int) $network_id;
    if (!$network_id) {
        $network_id = get_current_network_id();
    }
    if ('users' === $using) {
        $count = get_user_count($network_id);
        /**
         * Filters whether the network is considered large.
         *
         * @since 3.3.0
         * @since 4.8.0 The `$network_id` parameter has been added.
         *
         * @param bool   $is_large_network Whether the network has more than 10000 users or sites.
         * @param string $component        The component to count. Accepts 'users', or 'sites'.
         * @param int    $count            The count of items for the component.
         * @param int    $network_id       The ID of the network being checked.
         */
        return apply_filters('wp_is_large_network', $count > 10000, 'users', $count, $network_id);
    }
    $count = get_blog_count($network_id);
    /** This filter is documented in wp-includes/ms-functions.php */
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count, $network_id);
}

WordPress Version: 5.1

/**
 * Whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter.
 *
 * @since 3.3.0
 * @since 4.8.0 The `$network_id` parameter has been added.
 *
 * @param string   $using      'sites or 'users'. Default is 'sites'.
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites', $network_id = null)
{
    $network_id = (int) $network_id;
    if (!$network_id) {
        $network_id = get_current_network_id();
    }
    if ('users' == $using) {
        $count = get_user_count($network_id);
        /**
         * Filters whether the network is considered large.
         *
         * @since 3.3.0
         * @since 4.8.0 The `$network_id` parameter has been added.
         *
         * @param bool   $is_large_network Whether the network has more than 10000 users or sites.
         * @param string $component        The component to count. Accepts 'users', or 'sites'.
         * @param int    $count            The count of items for the component.
         * @param int    $network_id       The ID of the network being checked.
         */
        return apply_filters('wp_is_large_network', $count > 10000, 'users', $count, $network_id);
    }
    $count = get_blog_count($network_id);
    /** This filter is documented in wp-includes/ms-functions.php */
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count, $network_id);
}

WordPress Version: 4.8

/**
 * Whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter.
 *
 * @since 3.3.0
 * @since 4.8.0 The $network_id parameter has been added.
 *
 * @param string   $using      'sites or 'users'. Default is 'sites'.
 * @param int|null $network_id ID of the network. Default is the current network.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites', $network_id = null)
{
    $network_id = (int) $network_id;
    if (!$network_id) {
        $network_id = get_current_network_id();
    }
    if ('users' == $using) {
        $count = get_user_count($network_id);
        /**
         * Filters whether the network is considered large.
         *
         * @since 3.3.0
         * @since 4.8.0 The $network_id parameter has been added.
         *
         * @param bool   $is_large_network Whether the network has more than 10000 users or sites.
         * @param string $component        The component to count. Accepts 'users', or 'sites'.
         * @param int    $count            The count of items for the component.
         * @param int    $network_id       The ID of the network being checked.
         */
        return apply_filters('wp_is_large_network', $count > 10000, 'users', $count, $network_id);
    }
    $count = get_blog_count($network_id);
    /** This filter is documented in wp-includes/ms-functions.php */
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count, $network_id);
}

WordPress Version: 4.6

/**
 * Whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter.
 *
 * @since 3.3.0
 * @param string $using 'sites or 'users'. Default is 'sites'.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites')
{
    if ('users' == $using) {
        $count = get_user_count();
        /**
         * Filters whether the network is considered large.
         *
         * @since 3.3.0
         *
         * @param bool   $is_large_network Whether the network has more than 10000 users or sites.
         * @param string $component        The component to count. Accepts 'users', or 'sites'.
         * @param int    $count            The count of items for the component.
         */
        return apply_filters('wp_is_large_network', $count > 10000, 'users', $count);
    }
    $count = get_blog_count();
    /** This filter is documented in wp-includes/ms-functions.php */
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count);
}

WordPress Version: 3.8

/**
 * Whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the 'wp_is_large_network' filter.
 *
 * @since 3.3.0
 * @param string $using 'sites or 'users'. Default is 'sites'.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites')
{
    if ('users' == $using) {
        $count = get_user_count();
        /**
         * Filter whether the network is considered large.
         *
         * @since 3.3.0
         *
         * @param bool   $is_large_network Whether the network has more than 10000 users or sites.
         * @param string $component        The component to count. Accepts 'users', or 'sites'.
         * @param int    $count            The count of items for the component.
         */
        return apply_filters('wp_is_large_network', $count > 10000, 'users', $count);
    }
    $count = get_blog_count();
    /** This filter is documented in wp-includes/ms-functions.php */
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count);
}

WordPress Version: 3.7

/**
 * Whether or not we have a large network.
 *
 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
 * Plugins can alter this criteria using the 'wp_is_large_network' filter.
 *
 * @since 3.3.0
 * @param string $using 'sites or 'users'. Default is 'sites'.
 * @return bool True if the network meets the criteria for large. False otherwise.
 */
function wp_is_large_network($using = 'sites')
{
    if ('users' == $using) {
        $count = get_user_count();
        return apply_filters('wp_is_large_network', $count > 10000, 'users', $count);
    }
    $count = get_blog_count();
    return apply_filters('wp_is_large_network', $count > 10000, 'sites', $count);
}