Retrieves all of the WordPress supported post statuses.
Description
Posts have a limited set of valid status values, this provides the post_status values and descriptions.
Source
function get_post_statuses() {
$status = array(
'draft' => __( 'Draft' ),
'pending' => __( 'Pending Review' ),
'private' => __( 'Private' ),
'publish' => __( 'Published' ),
);
return $status;
}
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
Note that
get_post_statuses
returns a hard-coded list of statuses as indicated by the code sample. This list is missing core statuses such as ‘future’.To actually see the list of all post statuses available in your WordPress instance, use
get_post_stati
(https://developer.wordpress.org/reference/functions/get_post_stati/).Get all statuses including custom statuses.
Referenced from: https://wordpress.stackexchange.com/a/331154