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



get_post_status_object › WordPress Function

Since3.0.0
已弃用n/a
get_post_status_object ( $post_status )
参数:
  • (string) $post_status The name of a registered post status.
    Required: Yes
查看:
返回:
  • (stdClass|null) A post status object.
定义在:
文档:

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 ];
}