Uses
Uses | Description |
---|---|
wp-includes/post.php: get_post_type_object() | Retrieves a post type object by name. |
Checks if a given post type can be viewed or managed.
(WP_Post_Type|string) (Required) Post type name or object.
(bool) Whether the post type is allowed in REST.
File: wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
protected function check_is_post_type_allowed( $post_type ) { if ( ! is_object( $post_type ) ) { $post_type = get_post_type_object( $post_type ); } if ( ! empty( $post_type ) && ! empty( $post_type->show_in_rest ) ) { return true; } return false; }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/check_is_post_type_allowed