Select

Select

Key

Default

Description

id

unique

an unique id - use nice name

type

select

type of option

title

null

title of field

desc

null

decription of field. this is showing below title. can be used html

help

null

help tooltip of field

class

null

extra class of field.

wrap_class

null

extra class of field wrapper

dependency

null

dependency for showing and hiding fields see an example

before

null

extra text for field before area

after

null

extra text for field after area

name

null

name of field

debug

null

showing all config information

debug_light

null

showing some config information

attirbutes

array

attributes of field. supporting only html standard attributes see an example

sanitize

null

sanitize of field. can be enabled or disabled

validate

null

validate of field. can be enabled or disabled

multilang

false

multilangual support of field

show_only_lang

null

multilangual support for language keys eg. ‘en’ or ‘tr’ or ‘es’

Extra Key

options

array

options of radios

query_args

array

query args for wordpress core radios

default

array

default value of field

default_option

array

default option for first select option

array(
  'id'             => 'unique_option_501',
  'type'           => 'select',
  'title'          => 'Select Field',
  'options'        => array(
    'bmw'          => 'BMW',
    'mercedes'     => 'Mercedes',
    'audi'         => 'Audi',
  ),
  'default_option' => 'Select a car',
),
array(
  'id'         => 'unique_option_503',
  'type'       => 'select',
  'title'      => 'Select Field',
  'options'    => array(
    'green'    => 'Green',
    'blue'     => 'Blue',
    'yellow'   => 'Yellow',
  ),
  'attributes' => array(
    'multiple' => 'multiple',
    'style'    => 'width: 125px; height: 125px;',
  ),
  'default'    => array( 'blue', 'red' ),
),

array(
  'id'           => 'dep_14',
  'type'         => 'select',
  'title'        => 'If size <u>middle</u>',
  'Group 1' => array(
    'blue'   => 'Blue',
    'green'  => 'Green',
    'yellow' => 'Yellow',
    ),
  'Group 2' => array(
    'red'   => 'Red',
    'black' => 'Black',
    'white' => 'White',
    ),
),

Last updated