/**
* Snapshot_REST_API_Controller constructor.
*
* @throws Exception If the post type was not registered properly.
* @param string $post_type Post type.
*/
public function __construct($post_type)
{
$post_type_obj = get_post_type_object($post_type);
if (empty($post_type_obj) || empty($post_type_obj->customize_snapshot_post_type_obj)) {
throw new Exception('Missing customize_snapshot post type obj or arg for customize_snapshot_post_type_obj');
}
$this->snapshot_post_type = $post_type_obj->customize_snapshot_post_type_obj;
parent::__construct($post_type);
}