enable_live_network_counts

Filters whether to update network site or user counts when a new site is created.

Description

apply_filters( 'enable_live_network_counts', (bool) $is_small_network, (string) $sites ); 

Parameters (2)

0. $is_small_network (bool)
Whether the network is considered small.
1. $sites (string) => 'sites'
Context. Either users or sites..

Usage

To run the hook, copy the example below.
  1. $is_small_network = apply_filters( 'enable_live_network_counts', $is_small_network, $sites ); 
  2.  
  3. if ( !empty( $is_small_network ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the enable_live_network_counts callback 
  2. function filter_enable_live_network_counts( $is_small_network, $sites ) { 
  3. // make filter magic happen here... 
  4. return $is_small_network
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'enable_live_network_counts', 'filter_enable_live_network_counts', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'enable_live_network_counts', 'filter_enable_live_network_counts', 10, 2 ); 

Defined (2)

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

/wp-includes/ms-functions.php  
  1. if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) 
  1. if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) )