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
2178       * Filter whether to update network site or user counts when a new site is created.
2179       *
2180       * @since 3.7.0
2181       *
2182       * @see wp_is_large_network()
2183       *
2184       * @param bool   $small_network Whether the network is considered small.
2185       * @param string $context       Context. Either 'users' or 'sites'.
2186       */
2187      if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) )
2188           return;
2189
2190      wp_update_network_site_counts();
2191 }
2192
2193 /**
2194  * Update the network-wide users count.
2195  *
2196  * If enabled through the 'enable_live_network_counts' filter, update the users count
2197  * on a network when a user is created or its status is updated.
2198  *
2199  * @since 3.7.0
2200  */
2201 function wp_maybe_update_network_user_counts() {
2202      $is_small_network = ! wp_is_large_network( 'users' );
2203
2204      /** This filter is documented in wp-includes/ms-functions.php */
2205      if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) )
2206           return;
2207
2208      wp_update_network_user_counts();
2209 }
2210
2211 /**
2212  * Update the network-wide site count.
2213  *
2214  * @since 3.7.0