When deleting a post, all comments associated with this post get the status “post-trashed”. I’m searching a hook for this event.
Tried these one without success:
comment_approved_to_post-trashed
comment_approved_to_trash
When deleting a post, all comments associated with this post get the status “post-trashed”. I’m searching a hook for this event.
Tried these one without success:
comment_approved_to_post-trashed
comment_approved_to_trash
You must be logged in to post a comment.
There are few other hooks to manipulated the trashed comment.
There are probably few others too. But, it depends what you want to do with the trashed comments.
Sadly your hook didn’t trigger when deleting a post. But I just looked into the wordpress code and found the right hook:
* @uses do_action() on 'trashed_post_comments' after trashing
in the function
wp_trash_post_comments()
And then just add the action like that: