Skip to content
ajitbohra edited this page Dec 1, 2014 · 15 revisions

A select field. Options can be set manually by passing an array of option value => option name.

select

Uses Select2, a jQuery based replacement for select boxes.

Args

Required Args

  • id (string) (required)
  • name (string) (required) Field display name. Used as field label.
  • type 'select' (required)

Field Specific Args

  • options (array) (required) - option_value => Option Name
  • allow_none (bool) (optional) Enable option for 'none'.
  • multiple (bool) (optional) Enable multi select.

Optional Generic Args

See Optional Generic Args

Example Usage

array( 
	'id'      => 'example-field-select', 
	'name'    => 'Select Field', 
	'type'    => 'select', 
	'options' => array(
		'option-1' => 'Option 1',
		'option-2' => 'Option 2',
		'option-3' => 'Option 3',
	)
),