get_blog_count

The number of active sites on your installation.

Description

(int) get_blog_count( (int) $network_id = 0 ); 

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

Returns (int)

Parameters (1)

0. $network_id — Optional. (int)
Deprecated, not supported.

Usage

  1. if ( !function_exists( 'get_blog_count' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4. // Deprecated, not supported. 
  5. $network_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_blog_count($network_id); 
  9.  

Defined (1)

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

/wp-includes/ms-functions.php  
  1. function get_blog_count( $network_id = 0 ) { 
  2. if ( func_num_args() ) 
  3. _deprecated_argument( __FUNCTION__, '3.1.0' ); 
  4.  
  5. return get_site_option( 'blog_count' );