get_post_statuses()获取核心文章状态

目录

描述

Returns an array of the following core post statuses:

  • Draft
  • Pending Review
  • Private
  • Published

Note: To get an array of all post statuses, including those created with register_post_type(), see get_post_stati.

get_post_statuses() 描述

用法

<?php get_post_statuses(); ?>

get_post_statuses() 用法

参数

This function accepts no parameters.

get_post_statuses() 参数

返回值

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */

array(
	'draft'			=> __('Draft'),
	'pending'		=> __('Pending Review'),
	'private'		=> __('Private'),
	'publish'		=> __('Published')
);

get_post_statuses() 返回值

历史

  • 添加于 版本: 2.5.0

get_post_statuses() 历史

源文件

get_post_statuses() 函数的代码位于 wp-includes/post.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * 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;
}

get_post_statuses() 源文件

相关