wp_update_network_user_counts()
云策文档标注
概述
wp_update_network_user_counts() 是一个用于更新网络范围内用户计数的函数。它作为 wp_update_user_counts() 的包装器,简化了多站点环境下的用户统计更新操作。
关键要点
- 函数功能:更新整个网络(多站点)的用户总数。
- 参数:$network_id(可选),指定网络ID,默认为当前网络。
- 内部实现:直接调用 wp_update_user_counts() 函数。
- 版本历史:自 WordPress 3.7.0 引入,4.8.0 添加 $network_id 参数,6.0.0 改为包装器形式。
- 相关函数:与 wp_update_user_counts()、wp_update_network_counts() 和 wp_maybe_update_network_user_counts() 关联使用。
原文内容
Updates the network-wide user count.
Parameters
$network_idint|nulloptional-
ID of the network. Default is the current network.
Default:
null
Source
function wp_update_network_user_counts( $network_id = null ) {
wp_update_user_counts( $network_id );
}
Changelog
| Version | Description |
|---|---|
| 6.0.0 | This function is now a wrapper for wp_update_user_counts() . |
| 4.8.0 | The $network_id parameter has been added. |
| 3.7.0 | Introduced. |