wp_update_network_site_counts

Update the network-wide site count.

Description

wp_update_network_site_counts(); 

Usage

  1. if ( !function_exists( 'wp_update_network_site_counts' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_update_network_site_counts(); 
  7.  

Defined (1)

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

/wp-includes/ms-functions.php  
  1. function wp_update_network_site_counts() { 
  2. global $wpdb; 
  3.  
  4. $count = get_sites( array( 
  5. 'network_id' => $wpdb->siteid,  
  6. 'spam' => 0,  
  7. 'deleted' => 0,  
  8. 'archived' => 0,  
  9. 'count' => true,  
  10. ) ); 
  11.  
  12. update_site_option( 'blog_count', $count );