base.html.php
4 years ago
checkbox.html.php
4 years ago
file.html.php
4 years ago
hidden.html.php
4 years ago
label-content.html.php
4 years ago
label.html.php
4 years ago
radio.html.php
4 years ago
select.html.php
4 years ago
textarea.html.php
4 years ago
radio.html.php
23 lines
| 1 | <?php /** @var Give\Framework\FieldsAPI\Radio $field */ ?> |
| 2 | <?php /* Fieldsets + legends are terrible to style, so we just use the semantic markup and style something else. */ ?> |
| 3 | <fieldset> |
| 4 | <legend class="screen-reader-text"> |
| 5 | <?php include plugin_dir_path( __FILE__ ) . '/label-content.html.php'; ?> |
| 6 | </legend> |
| 7 | <div class="give-label" aria-hidden="true"> |
| 8 | <?php include plugin_dir_path( __FILE__ ) . '/label-content.html.php'; ?> |
| 9 | </div> |
| 10 | <?php foreach ( $field->getOptions() as $option ) : ?> |
| 11 | <label> |
| 12 | <input |
| 13 | type="radio" |
| 14 | name="give_<?php echo $field->getName(); ?>" |
| 15 | <?php echo $field->isRequired() ? 'required' : ''; ?> |
| 16 | <?php echo $option->getValue() === $field->getDefaultValue() ? 'checked' : ''; ?> |
| 17 | value="<?php echo $option->getValue(); ?>" |
| 18 | > |
| 19 | <?php echo $option->getLabel() ?: $option->getValue(); ?> |
| 20 | </label> |
| 21 | <?php endforeach; ?> |
| 22 | </fieldset> |
| 23 |