PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.1
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.1
1.8.13.1 1.8.13 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 All 212 releases
charitable / templates / donation-form / gateway-fields.php

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

68 lines 2.1 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 the gateway fields.
4 *
5 * @author WP Charitable LLC
6 * @package Charitable/Templates/Donation Form
7 * @since 1.0.0
8 * @version 1.0.0
9 */
10
11 // Exit if accessed directly.
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit;
14 }
15
16 if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) {
17 return;
18 }
19
20 $form = $view_args['form'];
21 $field = $view_args['field'];
22 $classes = $view_args['classes'];
23 $gateways = $field['gateways'];
24 $default = isset( $field['default'] ) && isset( $gateways[ $field['default'] ] ) ? $field['default'] : key( $gateways );
25
26 ?>
27 <fieldset id="charitable-gateway-fields" class="charitable-fieldset">
28 <?php
29 if ( isset( $field['legend'] ) ) : ?>
30
31 <div class="charitable-form-header"><?php echo $field['legend'] ?></div>
32
33 <?php
34 endif;
35
36 if ( count( $gateways ) > 1 ) :
37 ?>
38 <fieldset class="charitable-fieldset-field-wrapper">
39 <div class="charitable-fieldset-field-header" id="charitable-gateway-selector-header"><?php _e( 'Choose Your Payment Method', 'charitable' ) ?></div>
40 <ul id="charitable-gateway-selector" class="charitable-radio-list charitable-form-field">
41 <?php foreach ( $gateways as $gateway_id => $details ) : ?>
42 <li><input type="radio"
43 id="gateway-<?php echo esc_attr( $gateway_id ) ?>"
44 name="gateway"
45 value="<?php echo esc_attr( $gateway_id ) ?>"
46 aria-describedby="charitable-gateway-selector-header"
47 <?php checked( $default, $gateway_id ) ?> />
48 <label for="gateway-<?php echo esc_attr( $gateway_id ) ?>"><?php echo $details['label'] ?></label>
49 </li>
50 <?php endforeach ?>
51 </ul>
52 </fieldset>
53 <?php
54 endif;
55
56 foreach ( $gateways as $gateway_id => $details ) :
57
58 if ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) :
59 continue;
60 endif;
61
62 ?>
63 <div id="charitable-gateway-fields-<?php echo $gateway_id ?>" class="charitable-gateway-fields charitable-form-fields cf" data-gateway="<?php echo $gateway_id ?>">
64 <?php $form->view()->render_fields( $details['fields'] ) ?>
65 </div><!-- #charitable-gateway-fields-<?php echo $gateway_id ?> -->
66 <?php endforeach ?>
67 </fieldset><!-- .charitable-fieldset -->
68