untrashed_comment
Fires immediately after a comment is restored from the Trash.
Usage
add_action( 'untrashed_comment', 'wp_kama_untrashed_comment_action', 10, 2 );
/**
* Function for `untrashed_comment` action-hook.
*
* @param string $comment_id The comment ID as a numeric string.
* @param WP_Comment $comment The untrashed comment.
*
* @return void
*/
function wp_kama_untrashed_comment_action( $comment_id, $comment ){
// action...
}
- $comment_id(string)
- The comment ID as a numeric string.
- $comment(WP_Comment)
- The untrashed comment.
Changelog
| Since 2.9.0 | Introduced. |
| Since 4.9.0 | Added the $comment parameter. |
Where the hook is called
untrashed_comment
wp-includes/comment.php 1712
do_action( 'untrashed_comment', $comment->comment_ID, $comment );