Checkbox
This field type renders a checkbox.
- caption - text displayed next to the checkbox;
- check_value - value considered as "checked" (
true
by default).
The code below renders a required checkbox field with the
custom_field
name, "Custom field" label and "Custom text" caption.echo ( new HivePress\Fields\Checkbox(
[
'name' => 'custom_field',
'label' => 'Custom field',
'caption' => 'Custom text',
'required' => true,
]
) )->render();
Last modified 1yr ago