get_comment_statuses() WordPress Function

The get_comment_statuses() function is used to get the list of comment statuses. This function is located in wp-includes/comment.php.

get_comment_statuses() #

Retrieves all of the WordPress supported comment statuses.


Description

Comments have a limited set of valid status values, this provides the comment status values and descriptions.


Top ↑

Return

(string[]) List of comment status labels keyed by status.


Top ↑

Source

File: wp-includes/comment.php

function get_comment_statuses() {
	$status = array(
		'hold'    => __( 'Unapproved' ),
		'approve' => _x( 'Approved', 'comment status' ),
		'spam'    => _x( 'Spam', 'comment status' ),
		'trash'   => _x( 'Trash', 'comment status' ),
	);

	return $status;
}


Top ↑

Changelog

Changelog
VersionDescription
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More