Upgrader: Make clearing the Plugin and Theme update caches optional during install and upgrade proceedures. See #22704

Built from https://develop.svn.wordpress.org/trunk@25272


git-svn-id: http://core.svn.wordpress.org/trunk@25238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse
2013-09-06 01:33:09 +00:00
parent 4b40e7a646
commit 443aa35cfc
3 changed files with 130 additions and 79 deletions

View File

@@ -1764,3 +1764,16 @@ function settings_fields($option_group) {
echo '<input type="hidden" name="action" value="update" />';
wp_nonce_field("$option_group-options");
}
/**
* Clears the Plugins cache used by get_plugins() and by default, the Plugin Update cache.
*
* @since 3.7.0
*
* @param bool $clear_update_cache Whether to clear the Plugin updates cache
*/
function wp_clean_plugins_cache( $clear_update_cache = true ) {
if ( $clear_update_cache )
delete_site_transient( 'update_plugins' );
wp_cache_delete( 'plugins', 'plugins' );
}