Opened 15 years ago
Closed 11 years ago
#17542 closed enhancement (invalid)
Remove upload file after deleting custom background
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Customize | Keywords: | has-patch |
| Focuses: | administration | Cc: |
Description
I came across a comment on custom-background.php that says
@todo: uploaded files are not removed here.
So, I thought I will come up with this codes for the upload file deletion if user remove background.
Attached custom-background.diff
I had tested on my localhost.
Hope this contribution is useful.
Thanks.
Attachments (2)
Change History (8)
#2
@
15 years ago
- Keywords has-patch added
Not got a theme to test this with, but shouldn't we delete the attachment on reset as well?
Attaching a patch that does this and checks we actually have an attachment ID before trying to delete it.
#4
@
15 years ago
Nice initial work on this, both of you.
Because backgrounds are now stored with context => custom-background, then we're actually remembering previous backgrounds. Keeping the old background around after settings changes doesn't seem like a problem. But I'll leave that for the UX.
You should use the current trunk, there is a revert in your patch, see 'context' => 'custom-background' .