函数原型
get_post_status_object( string $post_status ): stdClass|null
函数描述
Retrieves a post status object by name.
是否弃用
未弃用
函数参数
-
$post_status
string
Required - The name of a registered post status.
函数返回值
stdClass|null A post status object.
函数位置
File: wp-includes/post.php.
函数源码
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 ];
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

