[wp-trac] [WordPress Trac] #31813: delete_post_{post_type}
WordPress Trac
noreply at wordpress.org
Thu Oct 1 01:20:15 UTC 2015
#31813: delete_post_{post_type}
-------------------------------+---------------------------
Reporter: GunGeekATX | Owner: DrewAPicture
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.4
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: has-patch close | Focuses:
-------------------------------+---------------------------
Changes (by johnbillion):
* keywords: has-patch 2nd-opinion => has-patch close
Comment:
While I rarely argue against the addition of hooks that have been proposed
to solve a demonstrated problem, I do think that in this case these hooks
are superfluous and don't provide enough value to warrant their
introduction.
The `Scrubber` plugin suffers from a fundamental problem whereby it relies
on enough context being available in the name of an action hook to clear
an associated transient. If, for example, there's a requirement for a
transient to be cleared whenever a post in a given category is edited,
then Scrubber doesn't have the means to do this because it lacks the
ability to inspect any of the contextual parameters passed to a hook.
Adding a `delete_post_{$post_type}` hook will fix the particular problem
of clearing a transient when a post of a given type is deleted, but
Scrubber is still left with its lack of contextual control.
The existing `delete_post`, `before_delete_post`, and `deleted_post` hooks
are plenty sufficient, and context is available via the `$postid`
parameter passed to each one.
Thanks for the patch and discussion, GunGeekATX and mattheweppelsheimer,
but I'm recommending this to be closed as wontfix.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31813#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list