PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / templates / form-fields / checkbox.php

checkbox.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0, at templates/form-fields/checkbox.php

50 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template used to display checkbox form fields.
4 *
5 * Override this template by copying it to yourtheme/charitable/form-fields/checkbox.php
6 *
7 * @author WP Charitable LLC
8 * @package Charitable/Templates/Form Fields
9 * @since 1.0.0
10 * @version 1.2.0
11 */
12
13 if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) {
14 return;
15 }
16
17 $form = $view_args['form'];
18 $field = $view_args['field'];
19 $classes = $view_args['classes'];
20 $is_required = isset( $field['required'] ) ? $field['required'] : false;
21 $value = isset( $field['value'] ) ? esc_attr( $field['value'] ) : '1';
22
23 if ( isset( $field['checked'] ) ) {
24 $checked = $field['checked'];
25 } else {
26 $checked = isset( $field['default'] ) ? $field['default'] : 0;
27 }
28 ?>
29 <div id="charitable_field_<?php echo $field['key']; ?>" class="<?php echo $classes; ?>">
30 <input
31 type="checkbox"
32 name="<?php echo $field['key']; ?>"
33 value="<?php echo $value; ?>"
34 id="charitable_field_<?php echo $field['key']; ?>_element"
35 <?php checked( $checked ); ?>
36 <?php echo charitable_get_arbitrary_attributes( $field ); ?>
37 />
38 <?php if ( isset( $field['label'] ) ) : ?>
39 <label for="charitable_field_<?php echo $field['key']; ?>_element">
40 <?php echo $field['label']; ?>
41 <?php if ( $is_required ) : ?>
42 <abbr class="required" title="required">*</abbr>
43 <?php endif ?>
44 </label>
45 <?php endif ?>
46 <?php if ( isset( $field['help'] ) ) : ?>
47 <p class="charitable-field-help"><?php echo $field['help']; ?></p>
48 <?php endif ?>
49 </div>
50