Returns all the possible statuses for a post type.
$typestringoptional
'post'.Default:'post'
function get_available_post_statuses( $type = 'post' ) {
$statuses = wp_count_posts( $type );
return array_keys( get_object_vars( $statuses ) );
}
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_available_post_statuses