wp_update_network_user_counts

Update the network-wide user count.

Description

wp_update_network_user_counts(); 

Usage

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

Defined (1)

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

/wp-includes/ms-functions.php  
  1. function wp_update_network_user_counts() { 
  2. global $wpdb; 
  3.  
  4. $count = $wpdb->get_var( "SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'" ); 
  5. update_site_option( 'user_count', $count );