clean_network_cache( int|array $ids )

In this article

Removes a network from the object cache.

Parameters

$idsint|arrayrequired
Network ID or an array of network IDs to remove from cache.

Source

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' );
}

Hooks

do_action( ‘clean_network_cache’, int $id )

Fires immediately after a network has been removed from the object cache.

Changelog

VersionDescription
4.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.