Opened 20 years ago
Closed 20 years ago
#2068 closed defect (bug) (fixed)
inline-uploading leaves thumbnail on disk even after deleting original image
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.0 |
| Component: | Administration | Keywords: | |
| Focuses: | Cc: |
Description
This seems to fix it. I see no reason to run an is_file() to check for its existence since unlink errors are suppressed.
Index: wp-includes/functions-post.php
===================================================================
--- wp-includes/functions-post.php (revision 3294)
+++ wp-includes/functions-post.php (working copy)
@@ -357,8 +357,11 @@
if ( ! empty($meta['file']) )
@ unlink($meta['file']);
- if ( ! empty($file) )
+ if ( ! empty($file) ) {
@ unlink($file);
+ $pathparts = pathinfo($file);
+ @ unlink($pathparts['dirname']."/thumb-".$pathparts['basename']);
+ }
do_action('delete_attachment', $postid);
Note: See
TracTickets for help on using
tickets.
(In [3303]) Thumbnails are now deleted unless the "still in use" query returns anything.