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;
|
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
Block a user