函数原型
get_available_post_statuses( string $type = ‘post’ ): string[]
函数描述
Returns all the possible statuses for a post type.
是否弃用
未弃用
函数参数
-
$type
string
Optional - The post_type you want the statuses for. Default
'post'.Default:
'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. |

