Tribe__Settings_Tab::addTab( array $tabs )

filters the tabs array from Tribe__Settings and adds the current tab to it does not add a tab if it’s empty


Parameters

$tabs

(array) (Required) the $tabs from Tribe__Settings


Top ↑

Return

(array) $tabs the filtered tabs


Top ↑

Source

File: src/Tribe/Settings_Tab.php

		public function addTab( $tabs ) {
			$hideSettingsTabs = Tribe__Settings_Manager::get_network_option( 'hideSettingsTabs', array() );
			if ( ( isset( $this->fields ) || has_action( 'tribe_settings_content_tab_' . $this->id ) ) && ( empty( $hideSettingsTabs ) || ! in_array( $this->id, $hideSettingsTabs ) ) ) {
				if ( ( is_network_admin() && $this->args['network_admin'] ) || ( ! is_network_admin() && ! $this->args['network_admin'] ) ) {
					$tabs[ $this->id ] = $this->name;
					add_filter( 'tribe_settings_fields', array( $this, 'addFields' ) );
					add_filter( 'tribe_settings_no_save_tabs', array( $this, 'showSaveTab' ) );
					add_filter( 'tribe_settings_content_tab_' . $this->id, array( $this, 'doContent' ) );
				}
			}

			return $tabs;
		}