get_available_post_statuses()
Returns all the possible statuses for a post type.
No Hooks.
Return
String[]
. An array of all the statuses for the supplied post type.
Usage
get_available_post_statuses( $type );
- $type(string)
- The post_type you want the statuses for.
Default: 'post'
Changelog
Since 2.5.0 | Introduced. |
get_available_post_statuses() get available post statuses code WP 6.8
function get_available_post_statuses( $type = 'post' ) { $statuses = wp_count_posts( $type ); return array_keys( get_object_vars( $statuses ) ); }