Checkbox field

The checkbox field: use it to switch things on and off.

Return values

String “1” if checkbox is checked.

Example


// Field slug is "checkboxExample"
// Note: $is_checked is not a boolean, but a string with value "1"
$is_checked = simple_fields_value('checkboxExample');
if ($is_checked) {
echo "Yep, it's checked!";
} else {
echo "Nope, it's not checked";
}

Output of above

[code]Nope, it’s not checked![/code]