函数文档

wp_update_network_counts()

💡 云策文档标注

概述

wp_update_network_counts() 函数用于更新当前网络范围内的计数,包括用户和站点数量。它通过调用 wp_update_network_user_counts() 和 wp_update_network_site_counts() 来实现。

关键要点

  • 函数更新网络范围内的用户和站点计数。
  • 接受一个可选的 $network_id 参数,默认为当前网络。
  • 在 WordPress 4.8.0 版本中引入了 $network_id 参数。
  • 相关函数包括 wp_update_network_user_counts() 和 wp_update_network_site_counts()。

📄 原文内容

Updates the network-wide counts for the current network.

Parameters

$network_idint|nulloptional
ID of the network. Default is the current network.

Default:null

Source

function wp_update_network_counts( $network_id = null ) {
	wp_update_network_user_counts( $network_id );
	wp_update_network_site_counts( $network_id );
}

Changelog

Version Description
4.8.0 The $network_id parameter has been added.
3.1.0 Introduced.