Changeset 55229 for trunk/src/wp-admin/includes/class-wp-upgrader.php
- Timestamp:
- 02/06/2023 02:46:01 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r55220 r55229 589 589 590 590 /* 591 * Partial updates may want to retain the destination. 592 * move_dir() returns a WP_Error when the destination exists, 593 * so copy_dir() should be used. 594 * 595 * If 'clear_working' is false, the source shouldn't be removed. 596 * After move_dir() runs, the source will no longer exist. 597 * Therefore, copy_dir() should be used. 591 * If 'clear_working' is false, the source should not be removed, so use copy_dir() instead. 592 * 593 * Partial updates, like language packs, may want to retain the destination. 594 * If the destination exists or has contents, this may be a partial update, 595 * and the destination should not be removed, so use copy_dir() instead. 598 596 */ 599 if ( $clear_destination && $args['clear_working'] ) { 597 if ( $args['clear_working'] 598 && ( 599 // Destination does not exist or has no contents. 600 ! $wp_filesystem->exists( $remote_destination ) 601 || empty( $wp_filesystem->dirlist( $remote_destination ) ) 602 ) 603 ) { 600 604 $result = move_dir( $source, $remote_destination, true ); 601 605 } else {
Note: See TracChangeset
for help on using the changeset viewer.