get_post_status_object( string $post_status ): stdClass|null
Retrieves a post status object by name.
Contents
Description
See also
Parameters
-
$post_status
string Required -
The name of a registered post status.
Return
stdClass|null A post status object.
Source
File: wp-includes/post.php
.
View all references
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 ];
}
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Examples
Alternatively, it also works like this:
print_r( $obj ) looks like this: