update_network_cache

Updates the network cache of given networks.

Description

update_network_cache( (array) $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.

Parameters (1)

0. $networks (array)
Array of network row objects.

Usage

  1. if ( !function_exists( 'update_network_cache' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-blogs.php'; 
  3.  
  4. // Array of network row objects. 
  5. $networks = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = update_network_cache($networks); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-blogs.php  
  1. function update_network_cache( $networks ) { 
  2. foreach ( (array) $networks as $network ) { 
  3. wp_cache_add( $network->id, $network, 'networks' );