wp_clean_plugins_cache

Clears the Plugins cache used by get_plugins() and by default, the Plugin Update cache.

Description

wp_clean_plugins_cache( (bool) $clear_update_cache = true ); 

Parameters (1)

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

Usage

  1. if ( !function_exists( 'wp_clean_plugins_cache' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/plugin.php'; 
  3.  
  4. // Whether to clear the Plugin updates cache 
  5. $clear_update_cache = true; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_clean_plugins_cache($clear_update_cache); 
  9.  

Defined (1)

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

/wp-admin/includes/plugin.php  
  1. function wp_clean_plugins_cache( $clear_update_cache = true ) { 
  2. if ( $clear_update_cache ) 
  3. delete_site_transient( 'update_plugins' ); 
  4. wp_cache_delete( 'plugins', 'plugins' );