comment_{$old_status}_to_{$new_status} WordPress Action Hook
The {$old_status}_to_{$new_status} hook is called when a comment's status is changed from {$old_status} to {$new_status}.
do_action( "comment_{$old_status}_to_{$new_status}", WP_Comment $comment ) #
Fires when the comment status is in transition from one specific status to another.
Description
The dynamic portions of the hook name, $old_status, and $new_status, refer to the old and new comment statuses, respectively.
Possible hook names include:
comment_unapproved_to_approvedcomment_spam_to_approvedcomment_approved_to_unapprovedcomment_spam_to_unapprovedcomment_unapproved_to_spamcomment_approved_to_spam
Parameters
- $comment
(WP_Comment)Comment object.
Source
File: wp-includes/comment.php
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |