Form_Settings_Page::render_tab_navigation( string $current_tab_id )

Renders the tab navigation.

Description

Parameters

$current_tab_id

(string) (Required) Identifier of the current tab.

Source

File: src/db-objects/forms/form-settings-page.php

	protected function render_tab_navigation( $current_tab_id ) {
		$tabs = array_intersect_key( $this->tabs, array_flip( wp_list_pluck( $this->subtabs, 'tab' ) ) );

		if ( count( $tabs ) > 1 ) : ?>
			<h2 class="nav-tab-wrapper">
				<?php foreach ( $tabs as $tab_id => $tab_args ) : ?>
					<a class="nav-tab<?php echo $tab_id === $current_tab_id ? ' nav-tab-active' : ''; ?>" href="<?php echo add_query_arg( 'tab', $tab_id ); ?>">
						<?php echo $tab_args['title']; ?>
					</a>
				<?php endforeach; ?>
			</h2>
		<?php else : ?>
			<h2 class="screen-reader-text">
				<?php echo $tabs[ $current_tab_id ]['title']; ?>
			</h2>
		<?php endif;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.