Uses
Uses | Description |
---|---|
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::__construct() | Constructor. |
wp-includes/post.php: get_post_type_object() | Retrieves a post type object by name. |
Constructor.
(string) (Required) Post type of the parent.
File: wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
public function __construct( $parent_post_type ) { $this->parent_post_type = $parent_post_type; $this->namespace = 'wp/v2'; $this->rest_base = 'revisions'; $post_type_object = get_post_type_object( $parent_post_type ); $this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name; $this->parent_controller = $post_type_object->get_rest_controller(); if ( ! $this->parent_controller ) { $this->parent_controller = new WP_REST_Posts_Controller( $parent_post_type ); } }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_revisions_controller/__construct