Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/wp-admin/includes/class-wp-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,20 @@ public function install_package( $args = array() ) {
}
}

// Copy new version of item into place.
$result = copy_dir( $source, $remote_destination );
/**
* Filters whether to use move_dir() or copy_dir().
*
* @since 6.2.0
*
* @param bool Default, false to use copy_dir().
* @param string $source File source location.
* @param string $remote_destination The remote package destination.
*/
if ( ! apply_filters( 'upgrader_use_move_dir', false, $source, $remote_destination ) ) {
$result = copy_dir( $source, $remote_destination );
} else {
$result = move_dir( $source, $remote_destination );
}

// Clear the working folder?
if ( $args['clear_working'] ) {
Expand Down