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
This commit is contained in:
David Baumwald
2022-03-23 18:02:27 +00:00
parent 55c399ff04
commit ee96cedcb8

View File

@@ -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.
);