WordPress开发者和主题制作者的搜索引擎



get_available_post_statuses ›

Since2.5.0
已弃用n/a
get_available_post_statuses ( $type = 'post' )
参数:
  • (string) $type The post_type you want the statuses for
    Required: No
    默认: 'post'
返回:
  • (array) As array of all the statuses for the supplied post type
定义在:
文档:

Get all the possible statuses for a post_type



源码

function get_available_post_statuses( $type = 'post' ) {
	$stati = wp_count_posts( $type );

	return array_keys( get_object_vars( $stati ) );
}