Returns all the possible statuses for a post type.
Parameters
$type
stringoptional- The post_type you want the statuses for. Default
'post'
.Default:
'post'
Source
function get_available_post_statuses( $type = 'post' ) {
$statuses = wp_count_posts( $type );
return array_keys( get_object_vars( $statuses ) );
}
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.