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

  1. if ( !function_exists( 'wp_is_large_network' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4. // 'sites or 'users'. Default is 'sites'. 
  5. $using = 'sites'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_is_large_network($using); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-functions.php  
  1. function wp_is_large_network( $using = 'sites' ) { 
  2. if ( 'users' == $using ) { 
  3. $count = get_user_count(); 
  4. /** 
  5. * Filters whether the network is considered large. 
  6. * @since 3.3.0 
  7. * @param bool $is_large_network Whether the network has more than 10000 users or sites. 
  8. * @param string $component The component to count. Accepts 'users', or 'sites'. 
  9. * @param int $count The count of items for the component. 
  10. */ 
  11. return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count ); 
  12.  
  13. $count = get_blog_count(); 
  14. /** This filter is documented in wp-includes/ms-functions.php */ 
  15. return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );