get_page_statuses(): string[]

In this article

Retrieves all of the WordPress support page statuses.

Description

Pages have a limited set of valid status values, this provides the post_status values and descriptions.

Return

string[] Array of page status labels keyed by their status.

Source

function get_page_statuses() {
	$status = array(
		'draft'   => __( 'Draft' ),
		'private' => __( 'Private' ),
		'publish' => __( 'Published' ),
	);

	return $status;
}

Changelog

VersionDescription
2.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.