Tribe__Tickets__Ticket_Object::get_provider()

Returns an instance of the provider class if found. If found, sets class property if not yet set.


Return

(Tribe__Tickets__Tickets|false) Ticket provider instance or False if provider is not active.


Top ↑

Source

File: src/Tribe/Ticket_Object.php

		public function get_provider() {
			if ( empty( $this->provider ) ) {
				if ( empty( $this->provider_class ) || ! class_exists( $this->provider_class ) ) {
					return null;
				}

				if ( method_exists( $this->provider_class, 'get_instance' ) ) {
					$this->provider = call_user_func( array( $this->provider_class, 'get_instance' ) );
				} else {
					$this->provider = new $this->provider_class;
				}
			}

			return $this->provider;
		}

Top ↑

Changelog

Changelog
Version Description
4.12.3 Use new helper method to account for possibly inactive ticket provider. Set provider if found.
4.1 Introduced.