Checkboxes Field

Check several options in a list.

The Checkboxes field offers several options the user can check independently.

Configuration

Go to Modern Fields > Fields groups and add the Checkboxes field. Its settings are in the inspector:

Effect
Checkboxes layoutVertical or Horizontal.
CheckboxesThe options offered, each with a label, a value, and whether it is checked by default. Each value must be unique: the settings panel flags a missing or duplicated key, and only the first option with a given value is displayed.
The Checkboxes field settings

Display the values

The field stores every option with its state: a list of items holding a label, a value and checked. Read it with get_field() and keep the checked ones:

PHP

Radio Buttons Field

Button Group Field


In this documentation