get_available_post_statuses() WordPress Function
The get_available_post_statuses() function is used to retrieve a list of available post statuses for the current user. This is useful for determining which statuses are available for use in the post editing screen.
get_available_post_statuses( string $type = 'post' ) #
Returns all the possible statuses for a post type.
Parameters
- $type
(string)(Optional)The post_type you want the statuses for.
Default value: 'post'
Return
(string[]) An array of all the statuses for the supplied post type.
Source
File: wp-admin/includes/post.php
function get_available_post_statuses( $type = 'post' ) { $stati = wp_count_posts( $type ); return array_keys( get_object_vars( $stati ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |