Skip to content

Commit

Permalink
Add required attr for checkbox field
Browse files Browse the repository at this point in the history
  • Loading branch information
bd-viget committed Jan 24, 2025
1 parent a5e1077 commit d9c0b28
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions blocks/checkbox/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
id="<?php echo esc_attr( $field->get_id_attr() ); ?>"
name="<?php echo esc_attr( $field->get_name_attr() ); ?>"
<?php checked( $field->is_checked() ); ?>
<?php if ( $field->is_required() ) : ?>
required="required"
<?php endif; ?>
>

<?php inner_blocks( $inner ); ?>
Expand Down

0 comments on commit d9c0b28

Please sign in to comment.