wp_clean_themes_cache

Clears the cache held by get_theme_roots() and WP_Theme.

Description

wp_clean_themes_cache( (bool) $clear_update_cache = true ); 

Parameters (1)

0. $clear_update_cache — Optional. (bool) => true
Whether to clear the Theme updates cache

Usage

  1. if ( !function_exists( 'wp_clean_themes_cache' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4. // Whether to clear the Theme updates cache 
  5. $clear_update_cache = true; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_clean_themes_cache($clear_update_cache); 
  9.  

Defined (1)

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

/wp-includes/theme.php  
  1. function wp_clean_themes_cache( $clear_update_cache = true ) { 
  2. if ( $clear_update_cache ) 
  3. delete_site_transient( 'update_themes' ); 
  4. foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme ) 
  5. $theme->cache_delete();