From ee96cedcb891c6a6e5b7b30a6f1c247345161b88 Mon Sep 17 00:00:00 2001 From: David Baumwald Date: Wed, 23 Mar 2022 18:02:27 +0000 Subject: [PATCH] Upgrade/Install: Fix the docs for the default value of `$clear_working` in `WP_Upgrader::run`. The current docblock for `WP_Upgrader::run` indicates the default value for the `clear_working` key of the `$options` argument is `false`. However, in the code directly below, the default is shown to be `true. This change updates the docblock to correct the default. This commit also reorders the `$defaults` to match the order they appear in the docblock. Props paulkevan. Fixes #55450. git-svn-id: https://develop.svn.wordpress.org/trunk@52986 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-upgrader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index 8684e46871..e30da50c2c 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -652,7 +652,7 @@ class WP_Upgrader { * destination folder. Default false. * @type bool $clear_working Whether to delete the files from the working * directory after copying them to the destination. - * Default false. + * Default true. * @type bool $abort_if_destination_exists Whether to abort the installation if the destination * folder already exists. When true, `$clear_destination` * should be false. Default true. @@ -672,8 +672,8 @@ class WP_Upgrader { 'package' => '', // Please always pass this. 'destination' => '', // ...and this. 'clear_destination' => false, - 'abort_if_destination_exists' => true, // Abort if the destination directory exists. Pass clear_destination as false please. 'clear_working' => true, + 'abort_if_destination_exists' => true, // Abort if the destination directory exists. Pass clear_destination as false please. 'is_multi' => false, 'hook_extra' => array(), // Pass any extra $hook_extra args here, this will be passed to any hooked filters. );