get_post_status_object

函数


get_post_status_object ( $post_status )
参数
  • (string)
    $post_status
    The name of a registered post status.
    Required:
返回值
  • (stdClass|null) A post status object.
相关
  • register_post_status()
定义位置
  • wp-includes/post.php
    , line 1384
引入
3.0.0
弃用

Retrieves a post status object by name.

function get_post_status_object( $post_status ) {
	global $wp_post_statuses;

	if ( empty( $wp_post_statuses[ $post_status ] ) ) {
		return null;
	}

	return $wp_post_statuses[ $post_status ];
}