From 8abd8624be6eacbdd507ab3383bbd92ee9b6fb6e Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 30 Mar 2012 14:46:52 +0000 Subject: [PATCH] Clear WP_Theme caches on update. fixes #20331. git-svn-id: https://develop.svn.wordpress.org/trunk@20329 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/class-wp-upgrader.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index b7e4d04ecf..408dbc0e0a 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -412,6 +412,7 @@ class Plugin_Upgrader extends WP_Upgrader { // Force refresh of plugin update information delete_site_transient('update_plugins'); + wp_cache_delete( 'plugins', 'plugins' ); return true; } @@ -456,6 +457,7 @@ class Plugin_Upgrader extends WP_Upgrader { // Force refresh of plugin update information delete_site_transient('update_plugins'); + wp_cache_delete( 'plugins', 'plugins' ); } function bulk_upgrade($plugins) { @@ -537,6 +539,7 @@ class Plugin_Upgrader extends WP_Upgrader { // Force refresh of plugin update information delete_site_transient('update_plugins'); + wp_cache_delete( 'plugins', 'plugins' ); return $results; } @@ -763,6 +766,8 @@ class Theme_Upgrader extends WP_Upgrader { // Force refresh of theme update information delete_site_transient('update_themes'); + foreach ( wp_get_themes() as $theme ) + $theme->cache_delete(); return true; } @@ -809,6 +814,8 @@ class Theme_Upgrader extends WP_Upgrader { // Force refresh of theme update information delete_site_transient('update_themes'); + foreach ( wp_get_themes() as $theme ) + $theme->cache_delete(); return true; } @@ -896,6 +903,8 @@ class Theme_Upgrader extends WP_Upgrader { // Force refresh of theme update information delete_site_transient('update_themes'); + foreach ( wp_get_themes() as $theme ) + $theme->cache_delete(); return $results; }