clean_network_cache

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

WordPress Version: 6.3

/**
 * Removes a network from the object cache.
 *
 * @since 4.6.0
 *
 * @global bool $_wp_suspend_cache_invalidation
 *
 * @param int|array $ids Network ID or an array of network IDs to remove from cache.
 */
function clean_network_cache($ids)
{
    global $_wp_suspend_cache_invalidation;
    if (!empty($_wp_suspend_cache_invalidation)) {
        return;
    }
    $network_ids = (array) $ids;
    wp_cache_delete_multiple($network_ids, 'networks');
    foreach ($network_ids as $id) {
        /**
         * Fires immediately after a network has been removed from the object cache.
         *
         * @since 4.6.0
         *
         * @param int $id Network ID.
         */
        do_action('clean_network_cache', $id);
    }
    wp_cache_set_last_changed('networks');
}

WordPress Version: 6.1

/**
 * Removes a network from the object cache.
 *
 * @since 4.6.0
 *
 * @global bool $_wp_suspend_cache_invalidation
 *
 * @param int|array $ids Network ID or an array of network IDs to remove from cache.
 */
function clean_network_cache($ids)
{
    global $_wp_suspend_cache_invalidation;
    if (!empty($_wp_suspend_cache_invalidation)) {
        return;
    }
    $network_ids = (array) $ids;
    wp_cache_delete_multiple($network_ids, 'networks');
    foreach ($network_ids as $id) {
        /**
         * Fires immediately after a network has been removed from the object cache.
         *
         * @since 4.6.0
         *
         * @param int $id Network ID.
         */
        do_action('clean_network_cache', $id);
    }
    wp_cache_set('last_changed', microtime(), 'networks');
}

WordPress Version: 4.8

/**
 * Removes a network from the object cache.
 *
 * @since 4.6.0
 *
 * @global bool $_wp_suspend_cache_invalidation
 *
 * @param int|array $ids Network ID or an array of network IDs to remove from cache.
 */
function clean_network_cache($ids)
{
    global $_wp_suspend_cache_invalidation;
    if (!empty($_wp_suspend_cache_invalidation)) {
        return;
    }
    foreach ((array) $ids as $id) {
        wp_cache_delete($id, 'networks');
        /**
         * Fires immediately after a network has been removed from the object cache.
         *
         * @since 4.6.0
         *
         * @param int $id Network ID.
         */
        do_action('clean_network_cache', $id);
    }
    wp_cache_set('last_changed', microtime(), 'networks');
}

WordPress Version: 4.6

/**
 * Removes a network from the object cache.
 *
 * @since 4.6.0
 *
 * @param int|array $ids Network ID or an array of network IDs to remove from cache.
 */
function clean_network_cache($ids)
{
    foreach ((array) $ids as $id) {
        wp_cache_delete($id, 'networks');
        /**
         * Fires immediately after a network has been removed from the object cache.
         *
         * @since 4.6.0
         *
         * @param int $id Network ID.
         */
        do_action('clean_network_cache', $id);
    }
    wp_cache_set('last_changed', microtime(), 'networks');
}