Controls
Checkbox & Toggle
Checkbox and toggle controls are used to store boolean values for the block. See examples below to use these controls.
Control Settings
- Alongside Text – displays text alongside the checkbox/toggle
- Checked – set the default checked state
Usage
PHP
<?php if ( $attributes['control_name'] ) : ?>
<p>The value is True</p>
<?php else: ?>
<p>The value is False</p>
<?php endif; ?>
Handlebars
{{#if control_name}}
<p>The value is True</p>
{{else}}
<p>The value is False</p>
{{/if}}
Post Meta
<?php if ( get_lzb_meta( 'control_meta_name' ) ) : ?>
<p>The value is True</p>
<?php else: ?>
<p>The value is False</p>
<?php endif; ?>