Skip to main content

Tabs

Tabs can be used to group sets of inputs and save them all together. They are a useful alternative to multiple groups of inputs. Tabs takes all normal props, as well as inputs.

Value

Returns any[][]

$tabs = json_decode(fx_get_meta('id'), true);
$title = $tabs['About']['title'];
$description = $tabs['About']['description'];
$gallery_images = $tabs['Gallery']['images'];
$view_more_link = $tabs['Gallery']['view_more'];

Example

'id' => [
'type' => 'tabs',
'className' => 'my-class-name',
'tabPosition' => 'left',
'inputs' => [
'About' => [
'title' => [
'type' => 'textfield',
'title' => 'Title',
],
'description' => [
'type' => 'wp-editor',
'title' => 'Description',
],
],
'Gallery' => [
'view_more' => [
'type' => 'link',
'title' => 'View more link',
],
'images' => [
'type' => 'media',
'className' => 'section-media-class',
'detailed' => true,
'multiple' => true,
'title' => 'Gallery',
],
],
],
],

Props

className

Metabox class name

type: string

inputs

Meta inputs to render

type: object

defaultValue: {}

tabPosition

Position of the tabs, either top or left

type: enum('top'|'left')

defaultValue: 'top'

title

Metabox title

type: string