wpseek.com
A WordPress-centric search engine for devs and theme authors
update_site_cache › WordPress Function
Since4.6.0
Deprecatedn/a
› update_site_cache ( $sites, $update_meta_cache = true )
Parameters: (2) |
|
Defined at: |
|
Codex: | |
Change Log: |
|
Updates sites in cache.
Related Functions: update_sitemeta_cache, update_term_cache, update_post_cache, update_post_caches, update_user_caches
Source
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 ); } }