diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c2fe1228bf..e99a93b80d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -7644,8 +7644,10 @@ function wp_validate_boolean( $value ) { * Deletes a file. * * @since 4.2.0 + * @since 6.7.0 A return value was added. * * @param string $file The path to the file to delete. + * @return bool True on success, false on failure. */ function wp_delete_file( $file ) { /** @@ -7656,9 +7658,12 @@ function wp_delete_file( $file ) { * @param string $file Path to the file to delete. */ $delete = apply_filters( 'wp_delete_file', $file ); + if ( ! empty( $delete ) ) { - @unlink( $delete ); + return @unlink( $delete ); } + + return false; } /** @@ -7691,9 +7696,7 @@ function wp_delete_file_from_directory( $file, $directory ) { return false; } - wp_delete_file( $file ); - - return true; + return wp_delete_file( $file ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 5448ace375..7c4f27e1b8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58714'; +$wp_version = '6.7-alpha-58715'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.