enable_live_network_counts хук-фильтрWP 3.7.0

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

Использование

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(строка)
Context. Either 'users' or 'sites'.

Список изменений

С версии 3.7.0 Введена.

Где вызывается хук

wp_maybe_update_network_site_counts()
enable_live_network_counts
wp_maybe_update_network_user_counts()
enable_live_network_counts
wp_maybe_update_user_counts()
enable_live_network_counts
wp-includes/ms-functions.php 2455
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) {
wp-includes/ms-functions.php 2477
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
wp-includes/user.php 1389
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {

Где используется хук в WordPress

Использование не найдено.