comment_{$old_status}_to_{$new_status} WordPress Action Hook

The {$old_status}_to_{$new_status} hook is called when a comment's status is changed from {$old_status} to {$new_status}.

do_action( "comment_{$old_status}_to_{$new_status}", WP_Comment $comment ) #

Fires when the comment status is in transition from one specific status to another.


Description

The dynamic portions of the hook name, $old_status, and $new_status, refer to the old and new comment statuses, respectively.

Possible hook names include:

  • comment_unapproved_to_approved
  • comment_spam_to_approved
  • comment_approved_to_unapproved
  • comment_spam_to_unapproved
  • comment_unapproved_to_spam
  • comment_approved_to_spam

Top ↑

Parameters

$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