PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / Form / LegacyConsumer / templates / radio.html.php

radio.html.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/Form/LegacyConsumer/templates/radio.html.php

41 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /** @var Give\Framework\FieldsAPI\Radio $field */ ?>
3 <?php
4 /** @var string $fieldIdAttribute */ ?>
5 <?php
6 /* Fieldsets + legends are terrible to style, so we just use the semantic markup and style something else. */ ?>
7 <fieldset>
8 <legend class="screen-reader-text">
9 <?php
10 include plugin_dir_path(__FILE__) . 'label-content.html.php'; ?>
11 </legend>
12 <div class="give-label" aria-hidden="true">
13 <?php
14 include plugin_dir_path(__FILE__) . 'label-content.html.php'; ?>
15 </div>
16 <?php
17 foreach ($field->getOptions() as $index => $option) : ?>
18 <?php
19 $id = $fieldIdAttribute . '-' . $index; ?>
20 <label for="<?php
21 echo $id; ?>">
22 <input
23 type="radio"
24 name="<?php
25 echo $field->getName(); ?>"
26 id="<?php
27 echo $id; ?>"
28 <?php
29 echo $field->isRequired() ? 'required' : ''; ?>
30 <?php
31 echo $option->getValue() === $field->getDefaultValue() ? 'checked' : ''; ?>
32 value="<?php
33 echo $option->getValue(); ?>"
34 >
35 <?php
36 echo $option->getLabel() ?: $option->getValue(); ?>
37 </label>
38 <?php
39 endforeach; ?>
40 </fieldset>
41