[wp-trac] [WordPress Trac] #41228: No way to get the post ID after a comment is deleted
WordPress Trac
noreply at wordpress.org
Mon Jul 3 11:11:32 UTC 2017
#41228: No way to get the post ID after a comment is deleted
--------------------------+------------------------------
Reporter: henry.wright | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Changes (by SergeyBiryukov):
* component: General => Comments
Comment:
Replying to [comment:1 henry.wright]:
> Alternatively, the 2nd arg could be {{{$comment}}}, where {{{$comment}}}
is the (deleted) comment object.
Makes sense to me, but I think the same should be done for all the related
actions, for consistency:
* `delete_comment`
* `deleted_comment`
* `trash_comment`
* `trashed_comment`
* `untrash_comment`
* `untrashed_comment`
* `spam_comment`
* `spammed_comment`
* `unspam_comment`
* `unspammed_comment`
Or you could use one of the hooks in `wp_transition_comment_status()`,
e.g. `transition_comment_status`, which gets called on comment deletion
with `delete` as the new status, and does pass the full comment object to
the hook.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41228#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list