enable_live_network_counts

enable_live_network_counts

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('enable_live_network_counts') is found 3 times:

  • /wp-includes/ms-functions.php line 2455
    	 *
    	 * @param bool   $small_network Whether the network is considered small.
    	 * @param string $context       Context. Either 'users' or 'sites'.
    	 */
    	if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) {
    		return;
    	}
    
    	wp_update_network_site_counts( $network_id );
    }
    
    
  • /wp-includes/ms-functions.php line 2477
    function wp_maybe_update_network_user_counts( $network_id = null ) {
    	$is_small_network = ! wp_is_large_network( 'users', $network_id );
    
    	/** This filter is documented in wp-includes/ms-functions.php */
    	if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
    		return;
    	}
    
    	wp_update_network_user_counts( $network_id );
    }
    
    
  • /wp-includes/user.php line 1389
    	}
    
    	$is_small_network = ! wp_is_large_user_count( $network_id );
    	/** This filter is documented in wp-includes/ms-functions.php */
    	if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
    		return false;
    	}
    
    	return wp_update_user_counts( $network_id );
    }