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 is false.
Returns:
  • (bool|WP_Error) True on success, false or WP_Error on failure.
Defined at:

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.

Related Functions

wp_get_comment_status, get_comment_statuses, wp_transition_comment_status, wp_list_comments, wp_set_comment_cookies

Top Google Results

User discussions

wpseek mobile