WP_REST_Revisions_Controller::__construct PHP Method

__construct() public method

Constructor.
Since: 4.7.0
public __construct ( string $parent_post_type )
$parent_post_type string Post type of the parent.
    public function __construct($parent_post_type)
    {
        $this->parent_post_type = $parent_post_type;
        $this->parent_controller = new WP_REST_Posts_Controller($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;
    }