wp_is_large_network
Filters whether the network is considered large.
Использование
add_filter( 'wp_is_large_network', 'wp_kama_is_large_network_filter', 10, 4 );
/**
* Function for `wp_is_large_network` filter-hook.
*
* @param bool $is_large_network Whether the network has more than 10000 users or sites.
* @param string $component The component to count. Accepts 'users', or 'sites'.
* @param int $count The count of items for the component.
* @param int $network_id The ID of the network being checked.
*
* @return bool
*/
function wp_kama_is_large_network_filter( $is_large_network, $component, $count, $network_id ){
// filter...
return $is_large_network;
}
- $is_large_network(true|false)
- Whether the network has more than 10000 users or sites.
- $component(строка)
- The component to count. Accepts 'users', or 'sites'.
- $count(int)
- The count of items for the component.
- $network_id(int)
- The ID of the network being checked.
Список изменений
| С версии 3.3.0 | Введена. |
| С версии 4.8.0 | The $network_id parameter has been added. |
Где вызывается хук
wp_is_large_network
wp-includes/ms-functions.php 2729
return apply_filters( 'wp_is_large_network', $is_large_network, 'users', $count, $network_id );
wp-includes/ms-functions.php 2735
return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count, $network_id );