Opened 8 years ago
Last modified 8 months ago
#43990 assigned enhancement
Use wp_delete_file instead of unlink
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | low |
| Severity: | normal | Version: | |
| Component: | Filesystem API | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Use wp_delete instead of unlink as much as possible throughout the codebase.
Attachments (1)
Change History (10)
#1
@
8 years ago
- Summary changed from Use wp_delete instead of unlink to Use wp_delete_file instead of unlink
#3
@
8 years ago
- Milestone changed from Awaiting Review to Future Release
- Owner set to iandunn
- Priority changed from normal to low
- Status changed from new to accepted
- Type changed from defect (bug) to enhancement
43990.patch looks pretty good at first glance. wp_delete_file() uses the @ operator when it calls unlink(), so I don't think we need to keep it when calling wp_delete_file().
( I kinda think it shouldn't even be used inside wp_delete_file(), but that's another ticket :) )
#4
@
8 years ago
I wondered about the @ operator but figured I’d leave it since I don’t know why it was there in the first place. 😄
#5
@
8 years ago
@macbookandrew just for clarity, can you quickly detail why using wp_delete_file() is preferred?
#6
@
8 years ago
@desrosj Basically to standardize on one method for removing files, and also giving the option to use the wp_delete_file filter for every file deletion action.
That and @iandunn’s comment here: https://core.trac.wordpress.org/ticket/43546#comment:57
#8
@
8 months ago
- Keywords needs-refresh added; needs-testing removed
A little late, but 7 years later, @macbookandrew can you refresh the patch? It's not applying anymore.
Let's try harder to make it happen :)
This ticket was mentioned in PR #8842 on WordPress/wordpress-develop by @sainathpoojary.
8 months ago
#9
- Keywords needs-refresh removed
Trac ticket: #43990
#44014 was marked as a duplicate.