Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

wp_set_comment_status()

3 tags 1 category

wp_set_comment_status() — Sets the status of a comment. The ‘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, even when $wp_error is true.

Inputs: $comment_id (int|WP_Comment): Comment ID or WP_Comment object. $comment_status (string): New comment status, either ‘hold’, ‘approve’, ‘spam’, or ‘trash’. $wp_error (bool): 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. False for an invalid $comment_status regardless of $wp_error.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…