Commit 1e353ed1 authored by Jeremy Felt's avatar Jeremy Felt
Browse files

Leave file path untouched if not deleting an attachment

When `wp_delete_file()` is used directly, then we can assume that
the `delete_attachment` hook does not fire and the absolute file
path can be returned untouched.
parent 8c892d10
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ class S3_Uploads {
		$dir = wp_upload_dir();

		// When `wp_delete_file()` is called directly, it expects an absolute path.
		if ( $file_path === $this->original_file ) {
		if ( ! $this->original_file || $file_path === $this->original_file ) {
			return $file_path;
		}