The Checkbox field creates a single checkbox input option for the block.

Settings
- Help Text: Instructions to describe the data needed in the field.
- Default Value: The default value for this field (checked or unchecked) when adding the block.
PHP API Controls
- name
- label
- control
- type
- order
- location
- width
- help
- default
Template Usage
To display the Checkbox field in your template, use the field name you provided.
<?php block_field( 'housebroken' ); ?>
Example template file /blocks/block-block-lab-example.php
<?php // Block Lab Example Checkbox Field ?> <p>Is the pet housebroken?</p> <p><?php block_field( 'housebroken' ); ?></p>
To use the block with the Checkbox field on your site, locate it in the blocks menu.

It will then display within your post/page.

And on the front-end of your site.

The API will return a Boolean with ‘true’ as the default value.
<?php // Block Lab Example Checkbox Field ?> <p>Is the pet housebroken?</p> <?php if ( block_value( 'housebroken' ) ) { echo 'This pet is already housebroken.'; } else { echo 'This pet will need some training to become housebroken.'; } ?>