On this page
get_post_status_object( string $post_status ): stdClass|null
Retrieves a post status object by name.
Description
See also
Parameters
$post_statusstring 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 ];
}
Related
Used By
| Used By | Description |
|---|---|
| wp_force_plain_post_permalink() wp-includes/link-template.php | Determine whether post should always use a plain permalink structure. |
| is_post_status_viewable() wp-includes/post.php | Determines whether a post status is considered “viewable”. |
| WP_Privacy_Requests_Table::column_status() wp-admin/includes/class-wp-privacy-requests-table.php | Status column. |
| WP_Privacy_Requests_Table::get_views() wp-admin/includes/class-wp-privacy-requests-table.php | Get an associative array ( id => link ) with the list of views available on this table. |
| WP_REST_Post_Statuses_Controller::get_items() wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php | Retrieves all post statuses, depending on user context. |
| WP_REST_Post_Statuses_Controller::get_item_permissions_check() wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php | Checks if a given request has access to read a post status. |
| WP_REST_Post_Statuses_Controller::get_item() wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php | Retrieves a specific post status. |
| WP_REST_Posts_Controller::check_read_permission() wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Checks if a post can be read. |
| WP_REST_Posts_Controller::handle_status_param() wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Determines validity and normalizes the given status parameter. |
| wp_handle_comment_submission() wp-includes/comment.php | Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form. |
| _wp_translate_postdata() wp-admin/includes/post.php | Renames |
| map_meta_cap() wp-includes/capabilities.php | Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. |
| WP_Customize_Manager::save() wp-includes/class-wp-customize-manager.php | Handles customize_save WP Ajax request to save/update a changeset. |
| WP::parse_request() wp-includes/class-wp.php | Parses the request to find the correct WordPress query. |
| WP_Query::get_posts() wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
| url_to_postid() wp-includes/rewrite.php | Examines a URL and try to determine the post ID it represents. |
| redirect_canonical() wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
| wp_xmlrpc_server::_insert_post() wp-includes/class-wp-xmlrpc-server.php | Helper method for wp_newPost() and wp_editPost(), containing shared logic. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_post_status_object