refresh_blog_details

Clear the blog details cache.

Description

refresh_blog_details( (int) $blog_id = 0 ); 

Parameters (1)

0. $blog_id — Optional. (int)
Blog ID. Defaults to current blog.

Usage

  1. if ( !function_exists( 'refresh_blog_details' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-blogs.php'; 
  3.  
  4. // Optional. Blog ID. Defaults to current blog. 
  5. $blog_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = refresh_blog_details($blog_id); 
  9.  

Defined (1)

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

/wp-includes/ms-blogs.php  
  1. function refresh_blog_details( $blog_id = 0 ) { 
  2. $blog_id = (int) $blog_id; 
  3. if ( ! $blog_id ) { 
  4. $blog_id = get_current_blog_id(); 
  5.  
  6. $details = get_site( $blog_id ); 
  7. if ( ! $details ) { 
  8. // Make sure clean_blog_cache() gets the blog ID 
  9. // when the blog has been previously cached as 
  10. // non-existent. 
  11. $details = (object) array( 
  12. 'blog_id' => $blog_id,  
  13. 'domain' => null,  
  14. 'path' => null 
  15. ); 
  16.  
  17. clean_blog_cache( $details ); 
  18.  
  19. /** 
  20. * Fires after the blog details cache is cleared. 
  21. * @since 3.4.0 
  22. * @param int $blog_id Blog ID. 
  23. */