On this page
clean_network_cache( int|array $ids )
Removes a network from the object cache.
Parameters
$idsint|array Required-
Network ID or an array of network IDs to remove from cache.
Source
File: wp-includes/ms-network.php. View all references
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' );
}
Hooks
- do_action( 'clean_network_cache',
int $id ) -
Fires immediately after a network has been removed from the object cache.
Related
Uses
| Uses | Description |
|---|---|
| wp_cache_delete_multiple() wp-includes/cache.php | Deletes multiple values from the cache in one call. |
| wp_cache_set() wp-includes/cache.php | Saves the data to the cache. |
| do_action() wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
Used By
| Used By | Description |
|---|---|
| populate_network_meta() wp-admin/includes/schema.php | Creates WordPress network meta and sets the default values. |
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/clean_network_cache