update_network_cache() WordPress Function

The update_network_cache() function is used to update the internal network cache. This function is useful when you need to update the network cache and do not want to wait for the next scheduled cache update.

update_network_cache( array $networks ) #

Updates the network cache of given networks.


Description

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.


Top ↑

Parameters

$networks

(array)(Required)Array of network row objects.


Top ↑

Source

File: wp-includes/ms-network.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.