Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: enable_live_network_counts

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
2264       * Filters whether to update network site or user counts when a new site is created.
2265       *
2266       * @since 3.7.0
2267       *
2268       * @see wp_is_large_network()
2269       *
2270       * @param bool   $small_network Whether the network is considered small.
2271       * @param string $context       Context. Either 'users' or 'sites'.
2272       */
2273      if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) )
2274           return;
2275
2276      wp_update_network_site_counts();
2277 }
2278
2279 /**
2280  * Update the network-wide users count.
2281  *
2282  * If enabled through the {@see 'enable_live_network_counts'} filter, update the users count
2283  * on a network when a user is created or its status is updated.
2284  *
2285  * @since 3.7.0
2286  */
2287 function wp_maybe_update_network_user_counts() {
2288      $is_small_network = ! wp_is_large_network( 'users' );
2289
2290      /** This filter is documented in wp-includes/ms-functions.php */
2291      if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) )
2292           return;
2293
2294      wp_update_network_user_counts();
2295 }
2296
2297 /**
2298  * Update the network-wide site count.
2299  *
2300  * @since 3.7.0