wp_set_comment_status WordPress Action Hook

The wp_set_comment_status hook is used to set the status of a comment. The first parameter is the comment ID, and the second parameter is the new status. The new status can be 'approve', 'hold', or 'spam'.

do_action( 'wp_set_comment_status', string $comment_id, string $comment_status ) #

Fires immediately after transitioning a comment’s status from one to another in the database and removing the comment from the object cache, but prior to all status transition hooks.


Parameters

$comment_id

(string)Comment ID as a numeric string.

$comment_status

(string)Current comment status. Possible values include 'hold', '0', 'approve', '1', 'spam', and 'trash'.


Top ↑

Source

File: wp-includes/comment.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.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