get_post_status_object()

最后更新于:2021-11-26 22:40:16

get_post_status_object( string$post_status)

Retrieve a post status object by name.

参数

$post_status

(string) (Required) The name of a registered post status.

响应

(object|null) A post status object.

源文件

文件: gc-includes/post.php

function get_post_status_object( $post_status ) {
	global $gc_post_statuses;

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

	return $gc_post_statuses[ $post_status ];
}