update_site_cache( array $sites, bool $update_meta_cache = true )
Updates sites in cache.
Description Description
Parameters Parameters
- $sites
-
(array) (Required) Array of site objects.
- $update_meta_cache
-
(bool) (Optional) Whether to update site meta cache.
Default value: true
Source Source
File: wp-includes/ms-site.php
function update_site_cache( $sites, $update_meta_cache = true ) {
if ( ! $sites ) {
return;
}
$site_ids = array();
foreach ( $sites as $site ) {
$site_ids[] = $site->blog_id;
wp_cache_add( $site->blog_id, $site, 'sites' );
wp_cache_add( $site->blog_id . 'short', $site, 'blog-details' );
}
if ( $update_meta_cache ) {
update_sitemeta_cache( $site_ids );
}
}
Expand full source code Collapse full source code View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced the $update_meta_cache parameter. |
| 4.6.0 | Introduced. |