Action hook 'unspammed_comment'

in WP Core File wp-includes/comment.php at line 1761

View Source

unspammed_comment

Action Hook
Description
Fires immediately after a comment is unmarked as Spam.

Hook Information

File Location wp-includes/comment.php View on GitHub
Hook Type Action
Line Number 1761

Hook Parameters

Type Name Description
string $comment_id The comment ID as a numeric string.
WP_Comment $comment The comment unmarked as spam.

Usage Examples

Basic Usage
<?php
// Hook into unspammed_comment
add_action('unspammed_comment', 'my_custom_function', 10, 2);

function my_custom_function($comment_id, $comment) {
    // Your custom code here
}

Source Code Context

wp-includes/comment.php:1761 - How this hook is used in WordPress core
<?php
1756  		 * @since 4.9.0 Added the `$comment` parameter.
1757  		 *
1758  		 * @param string     $comment_id The comment ID as a numeric string.
1759  		 * @param WP_Comment $comment    The comment unmarked as spam.
1760  		 */
1761  		do_action( 'unspammed_comment', $comment->comment_ID, $comment );
1762  
1763  		return true;
1764  	}
1765  
1766  	return false;

PHP Documentation

<?php
/**
		 * Fires immediately after a comment is unmarked as Spam.
		 *
		 * @since 2.9.0
		 * @since 4.9.0 Added the `$comment` parameter.
		 *
		 * @param string     $comment_id The comment ID as a numeric string.
		 * @param WP_Comment $comment    The comment unmarked as spam.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/comment.php
Related Hooks

Related hooks will be displayed here in future updates.