X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8d3bb1a5dcfdea9857d3c88c3751f09593e34dc8..ef91a7f4f3c6468973e192335a27ec0e0faca0b5:/wp-admin/includes/class-theme-upgrader.php diff --git a/wp-admin/includes/class-theme-upgrader.php b/wp-admin/includes/class-theme-upgrader.php index 76129e34..b2571ee7 100644 --- a/wp-admin/includes/class-theme-upgrader.php +++ b/wp-admin/includes/class-theme-upgrader.php @@ -201,8 +201,10 @@ class Theme_Upgrader extends WP_Upgrader { add_filter('upgrader_source_selection', array($this, 'check_package') ); add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3); - // Clear cache so wp_update_themes() knows about the new theme. - add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); + if ( $parsed_args['clear_update_cache'] ) { + // Clear cache so wp_update_themes() knows about the new theme. + add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); + } $this->run( array( 'package' => $package, @@ -269,8 +271,10 @@ class Theme_Upgrader extends WP_Upgrader { add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2); add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); - // Clear cache so wp_update_themes() knows about the new theme. - add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); + if ( $parsed_args['clear_update_cache'] ) { + // Clear cache so wp_update_themes() knows about the new theme. + add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); + } $this->run( array( 'package' => $r['package'], @@ -329,8 +333,6 @@ class Theme_Upgrader extends WP_Upgrader { add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2); add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); - // Clear cache so wp_update_themes() knows about the new theme. - add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); $this->skin->header(); @@ -394,6 +396,9 @@ class Theme_Upgrader extends WP_Upgrader { $this->maintenance_mode(false); + // Refresh the Theme Update information + wp_clean_themes_cache( $parsed_args['clear_update_cache'] ); + /** This action is documented in wp-admin/includes/class-wp-upgrader.php */ do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', @@ -407,14 +412,10 @@ class Theme_Upgrader extends WP_Upgrader { $this->skin->footer(); // Cleanup our hooks, in case something else does a upgrade on this connection. - remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 ); remove_filter('upgrader_pre_install', array($this, 'current_before')); remove_filter('upgrader_post_install', array($this, 'current_after')); remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme')); - // Refresh the Theme Update information - wp_clean_themes_cache( $parsed_args['clear_update_cache'] ); - return $results; }