wp_is_large_network
Whether or not we have a large network.
Description
wp_is_large_network( (string) $using = 'sites' );
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 filter.
Parameters (1)
- 0. $using — Optional. (string) =>
'sites'
- 'sites or users.. Default is sites.
Usage
if ( !function_exists( 'wp_is_large_network' ) ) { require_once ABSPATH . WPINC . '/ms-functions.php'; } // 'sites or 'users'. Default is 'sites'. $using = 'sites'; // NOTICE! Understand what this does before running. $result = wp_is_large_network($using);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/ms-functions.php
- 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 );
- }