update_site_cache( array $sites, bool $update_meta_cache = true )  Updates sites in cache.   Parameters   $sites array Required    Array of site objects.    $update_meta_cache bool Optional    Whether to update site meta cache.   Default: true     Source  File: wp-includes/ms-site.php. View all references  function update_site_cache( $sites, $update_meta_cache = true ) {
	if ( ! $sites ) {
		return;
	}
	$site_ids          = array();
	$site_data         = array();
	$blog_details_data = array();
	foreach ( $sites as $site ) {
		$site_ids[]                                    = $site->blog_id;
		$site_data[ $site->blog_id ]                   = $site;
		$blog_details_data[ $site->blog_id . 'short' ] = $site;

	}
	wp_cache_add_multiple( $site_data, 'sites' );
	wp_cache_add_multiple( $blog_details_data, 'blog-details' );

	if ( $update_meta_cache ) {
		update_sitemeta_cache( $site_ids );
	}
}
   Related  Uses    Uses Description      wp_cache_add_multiple() wp-includes/cache.php   Adds multiple values to the cache in one call.     update_sitemeta_cache() wp-includes/ms-site.php   Updates metadata cache for list of site IDs.   
   Used By    Used By Description      _prime_site_caches() wp-includes/ms-site.php   Adds any sites from the given IDs to the cache that do not already exist in cache.     WP_MS_Sites_List_Tabl8b7c:f320:99b9:690f:4595:cd17:293a:c069prepare_items() wp-admin/includes/class-wp-ms-sites-list-table.php   Prepares the list of sites for display.   
    Changelog    Version Description     5.1.0 Introduced the $update_meta_cache parameter.   4.6.0 Introduced.    

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