Form_Settings_Page::add_subtab( string $id, array $args = array() )

Adds a sub-tab to the settings page.

Description

Parameters

$id

(string) (Required) Sub-tab identifier.

$args

(array) (Optional) Sub-tab arguments.

  • 'title'
    (string) Sub-tab title.
  • 'description'
    (string) Sub-tab description.
  • 'tab'
    (string) Identifier of the tab this sub-tab should belong to.

Default value: array()

Source

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

	public function add_subtab( $id, $args = array() ) {
		if ( ! empty( $args['tab'] ) ) {
			$prefix = $this->manager->get_prefix();

			if ( 0 !== strpos( $args['tab'], $prefix ) ) {
				$args['tab'] = $prefix . $args['tab'];
			}
		}

		$this->subtabs[ $id ] = wp_parse_args( $args, array(
			'title'       => '',
			'description' => '',
			'tab'         => '',
		) );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.