Introduce wp_clean_themes_cache() for upgrades and testing. fixes #20954.
git-svn-id: https://develop.svn.wordpress.org/trunk@21080 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ae215d1321
commit
38bc915f96
|
@ -763,10 +763,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||||
return $this->result;
|
return $this->result;
|
||||||
|
|
||||||
// Force refresh of theme update information
|
// Force refresh of theme update information
|
||||||
delete_site_transient('update_themes');
|
wp_clean_themes_cache();
|
||||||
search_theme_directories( true );
|
|
||||||
foreach ( wp_get_themes() as $theme )
|
|
||||||
$theme->cache_delete();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -812,10 +809,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||||
return $this->result;
|
return $this->result;
|
||||||
|
|
||||||
// Force refresh of theme update information
|
// Force refresh of theme update information
|
||||||
delete_site_transient('update_themes');
|
wp_clean_themes_cache();
|
||||||
search_theme_directories( true );
|
|
||||||
foreach ( wp_get_themes() as $theme )
|
|
||||||
$theme->cache_delete();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -902,10 +896,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||||
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
|
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
|
||||||
|
|
||||||
// Force refresh of theme update information
|
// Force refresh of theme update information
|
||||||
delete_site_transient('update_themes');
|
wp_clean_themes_cache();
|
||||||
search_theme_directories( true );
|
|
||||||
foreach ( wp_get_themes() as $theme )
|
|
||||||
$theme->cache_delete();
|
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,18 @@ function wp_get_theme( $stylesheet = null, $theme_root = null ) {
|
||||||
return new WP_Theme( $stylesheet, $theme_root );
|
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.
|
* Whether a child theme is in use.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue