From 39ce3bcae0a414d71922d2a0faf165433998b6cc Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 17 Aug 2024 19:52:46 +0000 Subject: [PATCH] Upgrade/Install: Remove the return value of `_wp_delete_all_temp_backups()`. This function is only utilized as a `shutdown` action callback, so the return value is not used anywhere. `wp_trigger_error()` is now used instead under the same conditions. Follow-up to [55720], [56342]. Props johnbillion, amitraj2203, narenin. Fixes #61116. git-svn-id: https://develop.svn.wordpress.org/trunk@58906 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/update.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php index f8aa27bd8d..c623b248b9 100644 --- a/src/wp-includes/update.php +++ b/src/wp-includes/update.php @@ -1099,8 +1099,6 @@ function wp_delete_all_temp_backups() { * @access private * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. - * - * @return void|WP_Error Void on success, or a WP_Error object on failure. */ function _wp_delete_all_temp_backups() { global $wp_filesystem; @@ -1114,15 +1112,17 @@ function _wp_delete_all_temp_backups() { ob_end_clean(); if ( false === $credentials || ! WP_Filesystem( $credentials ) ) { - return new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) ); + wp_trigger_error( __FUNCTION__, __( 'Could not access filesystem.' ) ); + return; } if ( ! $wp_filesystem->wp_content_dir() ) { - return new WP_Error( - 'fs_no_content_dir', + wp_trigger_error( + __FUNCTION__, /* translators: %s: Directory name. */ sprintf( __( 'Unable to locate WordPress content directory (%s).' ), 'wp-content' ) ); + return; } $temp_backup_dir = $wp_filesystem->wp_content_dir() . 'upgrade-temp-backup/';