update_site_cache

Updates sites in cache.

Description

update_site_cache( (array) $sites ); 

Parameters (1)

0. $sites (array)
Array of site objects.

Usage

  1. if ( !function_exists( 'update_site_cache' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-blogs.php'; 
  3.  
  4. // Array of site objects. 
  5. $sites = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = update_site_cache($sites); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-blogs.php  
  1. function update_site_cache( $sites ) { 
  2. if ( ! $sites ) { 
  3. return; 
  4.  
  5. foreach ( $sites as $site ) { 
  6. wp_cache_add( $site->blog_id, $site, 'sites' ); 
  7. wp_cache_add( $site->blog_id . 'short', $site, 'blog-details' );