Uses
Uses | Description |
---|---|
wp-includes/post.php: wp_count_posts() | Count number of posts of a post type and if user has permissions to view. |
Get all the possible statuses for a post_type
(string) (Optional) The post_type you want the statuses for.
Default value: 'post'
(string[]) An array of all the statuses for the supplied post type.
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 ) ); }
Version | Description |
---|---|
2.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_available_post_statuses