Skip to content

Commit 39ce3bc

Browse files
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
1 parent 4d8ac8b commit 39ce3bc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wp-includes/update.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,8 +1099,6 @@ function wp_delete_all_temp_backups() {
10991099
* @access private
11001100
*
11011101
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
1102-
*
1103-
* @return void|WP_Error Void on success, or a WP_Error object on failure.
11041102
*/
11051103
function _wp_delete_all_temp_backups() {
11061104
global $wp_filesystem;
@@ -1114,15 +1112,17 @@ function _wp_delete_all_temp_backups() {
11141112
ob_end_clean();
11151113

11161114
if ( false === $credentials || ! WP_Filesystem( $credentials ) ) {
1117-
return new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );
1115+
wp_trigger_error( __FUNCTION__, __( 'Could not access filesystem.' ) );
1116+
return;
11181117
}
11191118

11201119
if ( ! $wp_filesystem->wp_content_dir() ) {
1121-
return new WP_Error(
1122-
'fs_no_content_dir',
1120+
wp_trigger_error(
1121+
__FUNCTION__,
11231122
/* translators: %s: Directory name. */
11241123
sprintf( __( 'Unable to locate WordPress content directory (%s).' ), 'wp-content' )
11251124
);
1125+
return;
11261126
}
11271127

11281128
$temp_backup_dir = $wp_filesystem->wp_content_dir() . 'upgrade-temp-backup/';

0 commit comments

Comments
 (0)