wp_get_comment_status() – The status of a comment by ID.

You appear to be a bot. Output may be restricted

Description

Retrieves the status of a comment by comment ID.

Usage

$string|false = wp_get_comment_status( $comment_id );

Parameters

$comment_id
( int|WP_Comment ) required – Comment ID or WP_Comment object

Returns

string|false Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.

Source

File name: wordpress/wp-includes/comment.php
Lines:

1 to 22 of 22
function wp_get_comment_status( $comment_id ) {
  $comment = get_comment( $comment_id );
  if ( ! $comment ) {
    return false;
  }

  $approved = $comment->comment_approved;

  if ( null == $approved ) {
    return false;
  } elseif ( '1' == $approved ) {
    return 'approved';
  } elseif ( '0' == $approved ) {
    return 'unapproved';
  } elseif ( 'spam' === $approved ) {
    return 'spam';
  } elseif ( 'trash' === $approved ) {
    return 'trash';
  } else {
    return false;
  }
}
 

 View on GitHub View on Trac