Form_Settings_Page::get_current_subtab( string $current_tab_id )

Returns the identifier of the current sub-tab.

Description

Parameters

$current_tab_id

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

Return

(string) Identifier of the current sub-tab.

Source

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

	protected function get_current_subtab( $current_tab_id ) {
		if ( isset( $_GET['subtab'] ) ) {
			$current_subtab_id = wp_unslash( $_GET['subtab'] );

			if ( isset( $this->subtabs[ $current_subtab_id ] ) && $current_tab_id === $this->subtabs[ $current_subtab_id ]['tab'] ) {
				return $current_subtab_id;
			}
		}

		foreach ( $this->subtabs as $slug => $args ) {
			if ( $current_tab_id === $args['tab'] ) {
				return $slug;
			}
		}

		return key( $this->subtabs );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.