update_network_cache

The timeline below displays how wordpress function update_network_cache has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * 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.
 *
 * @since 4.6.0
 *
 * @param array $networks Array of network row objects.
 */
function update_network_cache($networks)
{
    $data = array();
    foreach ((array) $networks as $network) {
        $data[$network->id] = $network;
    }
    wp_cache_add_multiple($data, 'networks');
}

WordPress Version: 4.6

/**
 * 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.
 *
 * @since 4.6.0
 *
 * @param array $networks Array of network row objects.
 */
function update_network_cache($networks)
{
    foreach ((array) $networks as $network) {
        wp_cache_add($network->id, $network, 'networks');
    }
}