mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 07:22:01 +01:00
Introduce wp_clean_themes_cache() for upgrades and testing. fixes #20954.
git-svn-id: http://core.svn.wordpress.org/trunk@21080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0fe1e55cc3
commit
222425a917
@ -763,10 +763,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
return $this->result;
|
||||
|
||||
// Force refresh of theme update information
|
||||
delete_site_transient('update_themes');
|
||||
search_theme_directories( true );
|
||||
foreach ( wp_get_themes() as $theme )
|
||||
$theme->cache_delete();
|
||||
wp_clean_themes_cache();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -812,10 +809,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
return $this->result;
|
||||
|
||||
// Force refresh of theme update information
|
||||
delete_site_transient('update_themes');
|
||||
search_theme_directories( true );
|
||||
foreach ( wp_get_themes() as $theme )
|
||||
$theme->cache_delete();
|
||||
wp_clean_themes_cache();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -902,10 +896,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
|
||||
|
||||
// Force refresh of theme update information
|
||||
delete_site_transient('update_themes');
|
||||
search_theme_directories( true );
|
||||
foreach ( wp_get_themes() as $theme )
|
||||
$theme->cache_delete();
|
||||
wp_clean_themes_cache();
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
@ -106,6 +106,18 @@ function wp_get_theme( $stylesheet = null, $theme_root = null ) {
|
||||
return new WP_Theme( $stylesheet, $theme_root );
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the cache held by get_theme_roots() and WP_Theme.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
function wp_clean_themes_cache() {
|
||||
delete_site_transient('update_themes');
|
||||
search_theme_directories( true );
|
||||
foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme )
|
||||
$theme->cache_delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a child theme is in use.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user