Tribe__Tickets__Status__Manager::get_provider_class_from_slug( string|Tribe__Tickets__Tickets $slug )

Get the Provider class name from its slug.


Parameters #

$slug

(string|Tribe__Tickets__Tickets) (Required) The string of the slug, its module main class name, or instance.


Top ↑

Return #

(string|false) Provider class name or false if not found.


Top ↑

Source #

File: src/Tribe/Status/Manager.php

	public function get_provider_class_from_slug( $slug ) {
		if ( $slug instanceof Tribe__Tickets__Tickets ) {
			$slug = $slug->class_name;
		}

		// If already a class name (case-sensitive).
		if ( array_key_exists( $slug, $this->module_slugs ) ) {
			return $slug;
		}

		$slugs_to_classes = array_flip( $this->module_slugs );

		// Get class name from slug.
		$result = Tribe__Utils__Array::get( $slugs_to_classes, $slug );
		if ( ! empty( $result ) ) {
			return $result;
		}

		return false;
	}

Top ↑

Changelog #

Changelog
Version Description
4.12.3 Introduced.