Arguments
Name | Type | Default | Description |
---|
id | string | | A unique ID. This ID will be used to get the value |
type | string | tabbed | Type of the field |
title | string | | Title of the field |
default | array | | Default value from database, if the option doesn’t exist |
subtitle | string | | Subtitle to display below the title |
desc | string | | Description to display after the field |
help | string | | Text to display on right-corner (as hover/popup) the field |
class | string | | Extra CSS classes (space separated) to append to the field |
before | string | | Content to display before the field |
after | string | | Content to display after the field |
dependency | array | | Define field visibility depending on other field value |
attributes | array | | Extra HTML attributes to append to the field |
sanitize | string | | Callback function for sanitizing value |
validate | string | | Callback function for validating value |
EXTRAS | | | |
tabs | array | | An associative array containing fields for the fieldsets |
Simple Tabbed Field Example
array(
'id' => 'example-tabbed',
'type' => 'tabbed',
'title' => 'Tabbed',
'tabs' => array(
array(
'title' => 'Tab One',
'icon' => 'fa fa-heart',
'fields' => array(
array(
'id' => 'example-text',
'type' => 'text',
'title' => 'Text',
),
),
),
array(
'title' => 'Tab Two',
'icon' => 'fa fa-gear',
'fields' => array(
array(
'id' => example-color',
'type' => color',
'title' => 'Example Color',
),
),
),
),
),
Tabbed Field Example with Defaults
array(
'id' => 'example-tabbed',
'type' => 'tabbed',
'title' => 'Tabbed',
'tabs' => array(
array(
'title' => 'Tab One',
'icon' => 'fa fa-heart',
'fields' => array(
array(
'id' => 'example-text',
'type' => 'text',
'title' => 'Text',
),
array(
'id' => 'example-text-2',
'type' => 'text',
'title' => 'Text Two',
),
),
),
array(
'title' => 'Tab Two',
'icon' => 'fa fa-gear',
'fields' => array(
array(
'id' => example-color',
'type' => color',
'title' => 'Example Color',
),
array(
'id' => example-color-2',
'type' => color',
'title' => 'Example Color Two',
),
),
),
'default' => array(
'example-text' => 'This is Text Two Default',
'example-text-2' => 'This is the Second Default Text',
'example-color' => '#555',
'example-color-2' => '#999',
),
),
),