WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp get comment status

Contents

Description

The status of a comment by ID.

Usage

<?php wp_get_comment_status$comment_id ?>

Parameters

$comment_id
(integer) (required) Comment ID
Default: None

Return Values

(string|boolean) 
Status might be 'deleted', 'approved', 'unapproved', 'spam' or false on failure.

Examples

<?php
$status = wp_get_comment_status( $comment_id );
if ( $status == "approved" ) {
  // show the comment
}
?>

Notes

Change Log

Since: 1.0.0

Source File

wp_get_comment_status() is located in wp-includes/comment.php.

Related

 

See also index of Function Reference and index of Template Tags.