Adds a tab to the settings page.
Description
See also
Parameters
- $id
-
(string) (Required) Tab identifier.
- $args
-
(array) (Optional) Tab arguments.
- 'title'
(string) Tab title.
Default value: array()
- 'title'
Source
File: src/db-objects/forms/form-settings-page.php
public function add_tab( $id, $args = array() ) { $prefix = $this->manager->get_prefix(); if ( 0 !== strpos( $id, $prefix ) ) { $id = $prefix . $id; } $this->tabs[ $id ] = wp_parse_args( $args, array( 'title' => '', 'rest_description' => '', ) ); $services = array( 'ajax' => $this->manager->ajax(), 'assets' => $this->manager->assets(), 'error_handler' => $this->manager->error_handler(), ); $this->tabs[ $id ]['field_manager'] = new Field_Manager( $this->manager->get_prefix(), $services, array( 'get_value_callback_args' => array( $id ), 'update_value_callback_args' => array( $id, '{value}' ), 'name_prefix' => $id, ) ); }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |