enable_live_network_counts
Filters whether to update network site or user counts when a new site is created.
Usage
add_filter( 'enable_live_network_counts', 'wp_kama_enable_live_network_counts_filter', 10, 2 );
/**
* Function for `enable_live_network_counts` filter-hook.
*
* @param bool $small_network Whether the network is considered small.
* @param string $context Context. Either 'users' or 'sites'.
*
* @return bool
*/
function wp_kama_enable_live_network_counts_filter( $small_network, $context ){
// filter...
return $small_network;
}
- $small_network(true|false)
- Whether the network is considered small.
- $context(string)
- Context. Either 'users' or 'sites'.
Changelog
| Since 3.7.0 | Introduced. |
Where the hook is called
enable_live_network_counts
enable_live_network_counts
enable_live_network_counts
wp-includes/ms-functions.php 2512
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) {
wp-includes/ms-functions.php 2534
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
wp-includes/user.php 1500
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {