WordPress Version: 6.1
/**
* Retrieves a post status object by name.
*
* @since 3.0.0
*
* @global stdClass[] $wp_post_statuses List of post statuses.
*
* @see register_post_status()
*
* @param string $post_status The name of a registered post status.
* @return stdClass|null A post status object.
*/
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];
}