PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.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 / widgets / donate.php

donate.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.0, at templates/widgets/donate.php

46 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Display a widget with a link to donate to a campaign.
4 *
5 * Override this template by copying it to yourtheme/charitable/widgets/donate.php
6 *
7 * @package Charitable/Templates/Widgets
8 * @author WP Charitable LLC
9 * @since 1.0.0
10 * @version 1.5.0
11 */
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 if ( ! charitable_is_campaign_page() && 'current' == $view_args['campaign_id'] ) :
19 return;
20 endif;
21
22 $widget_title = apply_filters( 'widget_title', $view_args['title'] );
23 $campaign_id = 'current' == $view_args['campaign_id'] ? get_the_ID() : $view_args['campaign_id'];
24 $campaign = charitable_get_campaign( $campaign_id );
25
26 if ( ! $campaign || ! $campaign->can_receive_donations() ) :
27 return;
28 endif;
29
30 $suggested_donations = $campaign->get_suggested_donations();
31
32 if ( empty( $suggested_donations ) && ! $campaign->get( 'allow_custom_donations' ) ) :
33 return;
34 endif;
35
36 echo $view_args['before_widget'];
37
38 if ( ! empty( $widget_title ) ) :
39 echo $view_args['before_title'] . $widget_title . $view_args['after_title'];
40 endif;
41
42 $form = new Charitable_Donation_Amount_Form( $campaign );
43 $form->render();
44
45 echo $view_args['after_widget'];
46