Generates either a single select dropdown, or a multi-select input field

Field Options

  • Choices: A list of dropdown options, one per line. For each line, you can optionally use value : label. Use {empty} for an empty value.
  • Select multiple values?: Check this box to allow for the selection of multiple values

Return Value

(array) An array of selected values - even for single-select fields!

Template Usage

$values = CFS()->get('field_name');
foreach ($values as $value => $label) {
    echo '<p>' . $value . '</p>';