get_post_statuses()
get_post_statuses() 检索所有WordPress支持的post状态。Retrieve all…
get_post_statuses()
检索所有WordPress支持的post状态。
Retrieve all of the WordPress supported post statuses.
检索所有WordPress支持的post状态。
Retrieve all of the WordPress supported post statuses.
目录锚点:#说明#返回#源码#笔记
说明(Description)
帖子有一组有限的有效状态值,这提供了帖子的状态值和描述。
返回(Return)
(string[])由其状态键入的post状态标签数组。
源码(Source)
/**
* Retrieve all of the WordPress supported post statuses.
*
* Posts have a limited set of valid status values, this provides the
* post_status values and descriptions.
*
* @since 2.5.0
*
* @return array List of post statuses.
*/
function get_post_statuses() {
$status = array(
'draft' => __( 'Draft' ),
'pending' => __( 'Pending Review' ),
'private' => __( 'Private' ),
'publish' => __( 'Published' )
);
return $status;
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.5.0 | wp-includes/post.php:944 | 1 function | 1 function |
笔记(Notes)
注意,get_post_status返回一个硬编码的状态列表,如代码示例所示。此列表缺少核心状态,如“未来”。
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!