Form_Edit_Page_Handler::add_tab( string $id, array $args )

Adds a tab to the edit page.

Description

Parameters

$id

(string) (Required) Tab identifier.

$args

(array) (Optional) Tab arguments.

  • 'title'
    (string) Tab title.
  • 'description'
    (string) Tab description.
  • 'meta_box'
    (string) Identifier of the meta box this tab should belong to.

Source

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

	public function add_tab( $id, $args ) {
		if ( ! empty( $args['meta_box'] ) ) {
			$prefix = $this->form_manager->get_prefix();

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

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

Changelog

Changelog
Version Description
1.0.0 Introduced.