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
if ( !function_exists( 'wp_clean_plugins_cache' ) ) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } // Whether to clear the Plugin updates cache $clear_update_cache = true; // NOTICE! Understand what this does before running. $result = wp_clean_plugins_cache($clear_update_cache);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/plugin.php
- function wp_clean_plugins_cache( $clear_update_cache = true ) {
- if ( $clear_update_cache )
- delete_site_transient( 'update_plugins' );
- wp_cache_delete( 'plugins', 'plugins' );
- }