Tribe__Tickets__Attendee_Registration__Main::is_cart_rest()

Returns whether the user is on the /cart/ REST API endpoint.


Return

(bool) Whether the user is on the /cart/ REST API endpoint.


Top ↑

Source

File: src/Tribe/Attendee_Registration/Main.php

	public function is_cart_rest() {
		if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST || empty( $GLOBALS['wp']->query_vars['rest_route'] ) ) {
			return false;
		}

		/** @var Tribe__Tickets__REST__V1__Endpoints__Cart $cart */
		$cart = tribe( 'tickets.rest-v1.endpoints.cart' );

		return $cart->is_active;
	}

Top ↑

Changelog

Changelog
Version Description
4.11.0 Introduced.