wpseek.com
WordPress开发者和主题制作者的搜索引擎



update_network_cache › WordPress Function

Since4.6.0
已弃用n/a
update_network_cache ( $networks )
参数:
  • (array) $networks Array of network row objects.
    Required: Yes
定义在:
文档:

Updates the network cache of given networks.

Will add the networks in $networks to the cache. If network ID already exists in the network cache then it will not be updated. The network is added to the cache using the network group with the key using the ID of the networks.


源码

function update_network_cache( $networks ) {
	$data = array();
	foreach ( (array) $networks as $network ) {
		$data[ $network->id ] = $network;
	}
	wp_cache_add_multiple( $data, 'networks' );
}