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
This commit is contained in:
Sergey Biryukov 2020-07-29 13:07:35 +00:00
parent 014b40e623
commit c1101f08d5
2 changed files with 3 additions and 1 deletions

View File

@ -127,6 +127,7 @@ class Plugin_Upgrader extends WP_Upgrader {
$this->install_strings(); $this->install_strings();
add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
if ( $parsed_args['clear_update_cache'] ) { if ( $parsed_args['clear_update_cache'] ) {
// Clear cache so wp_update_plugins() knows about the new plugin. // Clear cache so wp_update_plugins() knows about the new plugin.
add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 ); add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );

View File

@ -239,6 +239,7 @@ class Theme_Upgrader extends WP_Upgrader {
add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
add_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ), 10, 3 ); add_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ), 10, 3 );
if ( $parsed_args['clear_update_cache'] ) { if ( $parsed_args['clear_update_cache'] ) {
// Clear cache so wp_update_themes() knows about the new theme. // Clear cache so wp_update_themes() knows about the new theme.
add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
@ -248,7 +249,7 @@ class Theme_Upgrader extends WP_Upgrader {
array( array(
'package' => $package, 'package' => $package,
'destination' => get_theme_root(), 'destination' => get_theme_root(),
'clear_destination' => $args['overwrite_package'], 'clear_destination' => $parsed_args['overwrite_package'],
'clear_working' => true, 'clear_working' => true,
'hook_extra' => array( 'hook_extra' => array(
'type' => 'theme', 'type' => 'theme',