spam_comment
Fires immediately before a comment is marked as Spam.
Usage
add_action( 'spam_comment', 'wp_kama_spam_comment_action', 10, 2 );
/**
* Function for `spam_comment` action-hook.
*
* @param int $comment_id The comment ID.
* @param WP_Comment $comment The comment to be marked as spam.
*
* @return void
*/
function wp_kama_spam_comment_action( $comment_id, $comment ){
// action...
}
- $comment_id(int)
- The comment ID.
- $comment(WP_Comment)
- The comment to be marked as spam.
Changelog
| Since 2.9.0 | Introduced. |
| Since 4.9.0 | Added the $comment parameter. |
Where the hook is called
spam_comment
wp-includes/comment.php 1693
do_action( 'spam_comment', $comment->comment_ID, $comment );