Tribe__Events__Aggregator__Tabs::is_active( string $slug = null )

Checks if a given Tab (slug) is active


Parameters

$slug

(string) (Optional) The Slug of the Tab

Default value: null


Top ↑

Return

(boolean) Is this tab active?


Top ↑

Source

File: src/Tribe/Aggregator/Tabs.php

	public function is_active( $slug = null ) {
		if ( ! Tribe__Events__Aggregator__Page::instance()->is_screen() ) {
			return false;
		}

		$slug = $this->get_requested_slug( $slug );

		// Fetch the Active Tab
		$tab = $this->get_active();

		// Compare
		return $slug === $tab->get_slug();
	}