Tribe__Tickets_Plus__REST__V1__Service_Provider::register_endpoints()

Registers the REST API endpoints for Event Tickets Plus

Contents


Source

File: src/Tribe/REST/V1/Service_Provider.php

	public function register_endpoints() {

		$qr_endpoint = tribe( 'tickets-plus.rest-v1.endpoints.qr' );

		$this->namespace = tribe( 'tickets-plus.rest-v1.main' )->get_events_route_namespace();

		register_rest_route( $this->namespace, '/qr/(?P<id>\\d+)', array(
			array(
				'methods'  => WP_REST_Server::READABLE,
				'args'     => $qr_endpoint->READ_args(),
				'callback' => array( $qr_endpoint, 'get' ),
			),
		) );

		register_rest_route( $this->namespace, '/qr', array(
			'methods'  => WP_REST_Server::READABLE,
			'args'     => $qr_endpoint->CHECK_IN_args(),
			'callback' => array( $qr_endpoint, 'check_in' ),
		) );

		/** @var Tribe__Documentation__Swagger__Builder_Interface $documentation */
		$doc_endpoint = tribe( 'tickets.rest-v1.endpoints.documentation' );
		$doc_endpoint->register_definition_provider( 'QR', new Tribe__Tickets_Plus__REST__V1__Documentation__QR_Definition_Provider() );

	}

Top ↑

Changelog

Changelog
Version Description
4.7.5 Introduced.