comment_spam_pingback
Fires when the status of a specific comment type is in transition.
The dynamic portions of the hook name, $new_status, and $comment->comment_type, refer to the new comment status, and the type of comment, respectively.
Typical comment types include 'comment', 'pingback', or 'trackback'.
This is one of the variants of the dynamic hook comment_(new_status)_(comment_type)
Usage
add_action( 'comment_spam_pingback', 'wp_kama_comment_spam_pingback_action', 10, 2 ); /** * Function for `comment_spam_pingback` action-hook. * * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment Comment object. * * @return void */ function wp_kama_comment_spam_pingback_action( $comment_id, $comment ){ // action... }
- $comment_id(string)
- The comment ID as a numeric string.
- $comment(WP_Comment)
- Comment object.
Changelog
Since 2.7.0 | Introduced. |
Where the hook is called
comment_spam_pingback
wp-includes/comment.php 1846
do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment );