Tribe__Events__Aggregator__Tabs::is_active( string $slug = null )
Checks if a given Tab (slug) is active
Contents
Parameters
- $slug
-
(string) (Optional) The Slug of the Tab
Default value: null
Return
(boolean) Is this tab active?
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();
}