clean_blog_cache( WP_Site|int $blog )  Clean the blog cache   Parameters   $blog WP_Site|int Required    The site object or ID to be cleared from cache.      Source  File: wp-includes/ms-site.php. View all references  function clean_blog_cache( $blog ) {
	global $_wp_suspend_cache_invalidation;

	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
		return;
	}

	if ( empty( $blog ) ) {
		return;
	}

	$blog_id = $blog;
	$blog    = get_site( $blog_id );
	if ( ! $blog ) {
		if ( ! is_numeric( $blog_id ) ) {
			return;
		}

		// Make sure a WP_Site object exists even when the site has been deleted.
		$blog = new WP_Site(
			(object) array(
				'blog_id' => $blog_id,
				'domain'  => null,
				'path'    => null,
			)
		);
	}

	$blog_id         = $blog->blog_id;
	$domain_path_key = md5( $blog->domain . $blog->path );

	wp_cache_delete( $blog_id, 'sites' );
	wp_cache_delete( $blog_id, 'site-details' );
	wp_cache_delete( $blog_id, 'blog-details' );
	wp_cache_delete( $blog_id . 'short', 'blog-details' );
	wp_cache_delete( $domain_path_key, 'blog-lookup' );
	wp_cache_delete( $domain_path_key, 'blog-id-cache' );
	wp_cache_delete( $blog_id, 'blog_meta' );

	/**
	 * Fires immediately after a site has been removed from the object cache.
	 *
	 * @since 4.6.0
	 *
	 * @param string  $id              Site ID as a numeric string.
	 * @param WP_Site $blog            Site object.
	 * @param string  $domain_path_key md5 hash of domain and path.
	 */
	do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );

	wp_cache_set( 'last_changed', microtime(), 'sites' );

	/**
	 * Fires after the blog details cache is cleared.
	 *
	 * @since 3.4.0
	 * @deprecated 4.9.0 Use {@see 'clean_site_cache'} instead.
	 *
	 * @param int $blog_id Blog ID.
	 */
	do_action_deprecated( 'refresh_blog_details', array( $blog_id ), '4.9.0', 'clean_site_cache' );
}
   Hooks     do_action( 'clean_site_cache', string $id, WP_Site $blog, string $domain_path_key )   
Fires immediately after a site has been removed from the object cache.      do_action_deprecated( 'refresh_blog_details', int $blog_id )   
Fires after the blog details cache is cleared.      Related  Uses    Uses Description      get_site() wp-includes/ms-site.php   Retrieves site data given a site ID or site object.     do_action_deprecated() wp-includes/plugin.php   Fires functions attached to a deprecated action hook.     WP_Sit8b7c:f320:99b9:690f:4595:cd17:293a:c069__construct() wp-includes/class-wp-site.php   Creates a new WP_Site object.     wp_cache_delete() wp-includes/cache.php   Removes the cache contents matching key and group.     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      wp_maybe_clean_new_site_cache_on_update() wp-includes/ms-site.php   Cleans the necessary caches after specific site data has been updated.     wp_initialize_site() wp-includes/ms-site.php   Runs the initialization routine for a given site.     wp_insert_site() wp-includes/ms-site.php   Inserts a new site into the database.     wp_update_site() wp-includes/ms-site.php   Updates a site in the database.     wp_delete_site() wp-includes/ms-site.php   Deletes a site from the database.     insert_blog() wp-includes/ms-deprecated.php   Store basic site info in the blogs table.     refresh_blog_details() wp-includes/ms-blogs.php   Clear the blog details cache.   
    Changelog    Version Description     3.5.0 Introduced.    

    
{'path': 'public/docs/wordpress/functions/clean_blog_cache.html', 'source': 'DevDocs.IO'}