wp_set_comment_status
wp_set_comment_status ( $comment_id, $comment_status, $wp_error = false )
Parameters:- (int|WP_Comment) comment_id Comment ID or WP_Comment object.
- (string) comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.
- (bool) wp_error Whether to return a WP_Error object if there is a failure. Default false.
Returns:- (bool|WP_Error) True on success, false or WP_Error on failure.
Defined at: - Introduced in WordPress: 1.0.0
- Deprecated in WordPress: —
Description
Sets the status of a comment.The {@see 'wp_set_comment_status'} action is called after the comment is handled.
If the comment status is not in the list, then false is returned.