Skip to content
mattheu edited this page Apr 16, 2013 · 15 revisions

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

Select Field

Uses Select2, a jQuery based replacement for select boxes.

Args

  • id (string) (required)
  • type 'text' (required)
  • options (array) (required) - option_value => Option Name
  • allow_none (bool) Enable option for 'none'.
  • repeatable (bool)
  • cols (int) [1-12]

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',
	)
),