get_available_post_statuses() - WordPress 函数参考中文文档

返回介绍

get_available_post_statuses()

发布于 2017-09-10 字数1244 浏览 912 评论 0

get_available_post_statuses( string $type = 'post' )

Get all the possible statuses for a post_type


描述


参数

$type

(string)
(Optional)
The post_type you want the statuses for

Default value: ‘post’


返回值

(array) As 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 描述
2.5.0 Introduced.

相关函数

Uses

  • wp-includes/post.php:
    wp_count_posts()

Used By

  • wp-admin/includes/post.php:
    wp_edit_posts_query()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!