comment_{$new_status}_{$comment->comment_type} WordPress Action Hook

The {$new_status}_{$comment->comment_type} hook is triggered when a comment's status is changed to {$new_status}.

do_action( "comment_{$new_status}_{$comment->comment_type}", string $comment_ID, WP_Comment $comment ) #

Fires when the status of a specific comment type is in transition.


Description

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’.

Possible hook names include:

  • comment_approved_comment
  • comment_approved_pingback
  • comment_approved_trackback
  • comment_unapproved_comment
  • comment_unapproved_pingback
  • comment_unapproved_trackback
  • comment_spam_comment
  • comment_spam_pingback
  • comment_spam_trackback

Top ↑

Parameters

$comment_ID

(string)The comment ID as a numeric string.

$comment

(WP_Comment)Comment object.


Top ↑

Source

File: wp-includes/comment.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More