本文整理汇总了PHP中wp_update_network_user_counts函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_update_network_user_counts函数的具体用法?PHP wp_update_network_user_counts怎么用?PHP wp_update_network_user_counts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_update_network_user_counts函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_maybe_update_network_user_counts
/**
* Update the network-wide users count.
*
* If enabled through the 'enable_live_network_counts' filter, update the users count
* on a network when a user is created or its status is updated.
*
* @since 3.7.0
*/
function wp_maybe_update_network_user_counts()
{
$is_small_network = !wp_is_large_network('users');
/** 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();
}
示例2: wp_maybe_update_network_user_counts
/**
* Update the network-wide users count.
*
* If enabled through the 'enable_live_network_counts' filter, update the users count
* on a network when a user is created or its status is updated.
*
* @since 3.7.0
*
* @uses wp_update_network_user_counts()
*/
function wp_maybe_update_network_user_counts()
{
$is_small_network = !wp_is_large_network('users');
/**
* Filter the decision to update network user and site counts in real time.
*
* @since 3.7.0
*
* @param bool $small_network Based on wp_is_large_network( $context ).
* @param string $context Context. Either 'users' or 'sites'.
*/
if (!apply_filters('enable_live_network_counts', $is_small_network, 'users')) {
return;
}
wp_update_network_user_counts();
}