From c1101f08d5e8b00935aa894ae2c0ef9ba6f616e1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 29 Jul 2020 13:07:35 +0000 Subject: [PATCH] Upgrade/Install: Pass correct argument to `clear_destination` in `Theme_Upgrader::install()`. Follow-up to [48390]. Props afragen, sabernhardt. Fixes #9757. git-svn-id: https://develop.svn.wordpress.org/trunk@48685 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-plugin-upgrader.php | 1 + src/wp-admin/includes/class-theme-upgrader.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-plugin-upgrader.php b/src/wp-admin/includes/class-plugin-upgrader.php index 53c7da1ced..a11fd1a1d9 100644 --- a/src/wp-admin/includes/class-plugin-upgrader.php +++ b/src/wp-admin/includes/class-plugin-upgrader.php @@ -127,6 +127,7 @@ class Plugin_Upgrader extends WP_Upgrader { $this->install_strings(); add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); + if ( $parsed_args['clear_update_cache'] ) { // Clear cache so wp_update_plugins() knows about the new plugin. add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 ); diff --git a/src/wp-admin/includes/class-theme-upgrader.php b/src/wp-admin/includes/class-theme-upgrader.php index a5901b9fc7..f087eb6281 100644 --- a/src/wp-admin/includes/class-theme-upgrader.php +++ b/src/wp-admin/includes/class-theme-upgrader.php @@ -239,6 +239,7 @@ 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 ); + 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 ); @@ -248,7 +249,7 @@ class Theme_Upgrader extends WP_Upgrader { array( 'package' => $package, 'destination' => get_theme_root(), - 'clear_destination' => $args['overwrite_package'], + 'clear_destination' => $parsed_args['overwrite_package'], 'clear_working' => true, 'hook_extra' => array( 'type' => 'theme',