Timeline for Using delete_attachment to prevent an attachment not working
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 1, 2022 at 2:22 | history | edited | phatskat | CC BY-SA 4.0 |
Update answer to reflect newer changes to WordPress
|
May 1, 2022 at 2:18 | comment | added | phatskat |
@Armstrongest just a note, since version 5.5 in 2020, a new filter was added called pre_delete_attachment that can be short-circuited to stop a delete from happening.
|
|
Oct 19, 2018 at 15:34 | comment | added | Armstrongest |
Upon further reflection, using die is definitely a pretty harsh way to prevent the deletion anyhow, I'm thinking there must be another hook earlier in the process.
|
|
Oct 19, 2018 at 15:18 | comment | added | Armstrongest | Thanks! I'm going to try this out to see if it works, but I'm pretty sure the first thing that I tried is die | |
Oct 19, 2018 at 14:34 | history | answered | phatskat | CC BY-SA 4.0 |