PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.14
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.14
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 / form-donation.php

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

75 lines 2.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 the default form.
4 *
5 * Override this template by copying it to yourtheme/charitable/donation-form/form-donation.php
6 *
7 * @author WP Charitable LLC
8 * @package Charitable/Templates/Donation Form
9 * @since 1.0.0
10 * @version 1.6.57
11 */
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 $form = $view_args['form'];
19 $user = wp_get_current_user();
20 $use_ajax = 'make_donation' == $form->get_form_action() && (int) Charitable_Gateways::get_instance()->gateways_support_ajax();
21 $form_id = isset( $view_args['form_id'] ) ? $view_args['form_id'] : charitable_get_donation_form_id();
22
23 if ( ! $form ) {
24 return;
25 }
26 ?>
27 <form method="post" id="<?php echo esc_attr( $form_id ); ?>" class="charitable-donation-form charitable-form" data-use-ajax="<?php echo esc_attr( $use_ajax ); ?>">
28 <?php
29 /**
30 * Do something before rendering the form fields.
31 *
32 * @since 1.0.0
33 * @since 1.6.0 Added $view_args parameter.
34 *
35 * @param Charitable_Form $form The form object.
36 * @param array $view_args All args passed to template.
37 */
38 do_action( 'charitable_form_before_fields', $form, $view_args );
39
40 ?>
41 <div class="charitable-form-fields cf">
42 <?php $form->view()->render(); ?>
43 </div><!-- .charitable-form-fields -->
44 <?php
45 /**
46 * Do something after rendering the form fields.
47 *
48 * @since 1.0.0
49 * @since 1.6.0 Added $view_args parameter.
50 *
51 * @param Charitable_Form $form The form object.
52 * @param array $view_args All args passed to template.
53 */
54 do_action( 'charitable_form_after_fields', $form, $view_args );
55
56 /**
57 * Add filter to determine if the submit button should appear for the donation form.
58 * 99.9% it should BUT there are cases - like spam busting - where we want to remove the ability for the donate form to be submitted.
59 *
60 * @since 1.7.0.9
61 *
62 */
63 $show_donation_button = apply_filters( 'charitable_show_donation_form_button', true, $form, $view_args );
64
65 if ( $show_donation_button ) :
66 ?>
67 <div class="charitable-form-field charitable-submit-field">
68 <button class="<?php echo esc_attr( charitable_get_button_class( 'donate' ) ); ?>" type="submit" name="donate"><?php _e( 'Donate', 'charitable' ); ?></button>
69 <div class="charitable-form-processing" style="display: none;">
70 <img src="<?php echo esc_url( charitable()->get_path( 'assets', false ) ); ?>images/charitable-loading.gif" width="60" height="60" alt="<?php esc_attr_e( 'Loading&hellip;', 'charitable' ); ?>" />
71 </div>
72 </div>
73 <?php endif; ?>
74 </form><!-- #<?php echo $form_id; ?>-->
75