[wp-trac] [WordPress Trac] #42030: Introduce pre_trash_post filter
WordPress Trac
noreply at wordpress.org
Fri Sep 29 09:50:44 UTC 2017
#42030: Introduce pre_trash_post filter
-------------------------+-----------------------------
Reporter: bor0 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
In `wp_delete_post` we have this neat filter `pre_delete_post` whether to
proceed with deletion. I was wondering why we don't have that for
`wp_trash_post`, i.e. `pre_trash_post`.
It can cause some issues, for example in our extensions we're querying
custom post types based on their trash status, and there are cases where
we don't want to allow them to be trashed (e.g. they have another post
type that links to the to-be-trashed one). However, once they're trashed,
our queries based on their trash status are erroneous.
Another point that was made by Marius Jensen on #core:
> I see no issue with introducing it to maintain parity with the delete
feature (trashing is a soft delete after all)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42030>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list