| @@ -4,11 +4,12 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * Override this template by copying it to yourtheme/charitable/widgets/donate.php |
| 6 | 6 | * |
| 7 | 7 | * @package Charitable/Templates/Widgets |
| 8 | - * @author Studio 164a | |
| 8 | + * @author WP Charitable LLC | |
| 9 | 9 | * @since 1.0.0 |
| 10 | 10 | * @version 1.5.0 |
| 11 | + * @version 1.8.8.6 | |
| 11 | 12 | */ |
| 12 | 13 | |
| 13 | 14 | // Exit if accessed directly. |
| 14 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -14,32 +15,32 @@ | ||
| 14 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | 16 | exit; |
| 16 | 17 | } |
| 17 | 18 | |
| 18 | -if ( ! charitable_is_campaign_page() && 'current' == $view_args['campaign_id'] ) : | |
| 19 | +if ( ! charitable_is_campaign_page() && 'current' == $view_args['campaign_id'] ) : // phpcs:ignore | |
| 19 | 20 | return; |
| 20 | 21 | endif; |
| 21 | 22 | |
| 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 ); | |
| 23 | +$charitable_widget_title = apply_filters( 'widget_title', $view_args['title'] ); | |
| 24 | +$charitable_campaign_id = 'current' == $view_args['campaign_id'] ? get_the_ID() : $view_args['campaign_id']; // phpcs:ignore | |
| 25 | +$charitable_campaign = charitable_get_campaign( $charitable_campaign_id ); | |
| 25 | 26 | |
| 26 | -if ( ! $campaign || ! $campaign->can_receive_donations() ) : | |
| 27 | +if ( ! $charitable_campaign || ! $charitable_campaign->can_receive_donations() ) : | |
| 27 | 28 | return; |
| 28 | 29 | endif; |
| 29 | 30 | |
| 30 | -$suggested_donations = $campaign->get_suggested_donations(); | |
| 31 | +$charitable_suggested_donations = $charitable_campaign->get_suggested_donations(); | |
| 31 | 32 | |
| 32 | -if ( empty( $suggested_donations ) && ! $campaign->get( 'allow_custom_donations' ) ) : | |
| 33 | +if ( empty( $charitable_suggested_donations ) && ! $charitable_campaign->get( 'allow_custom_donations' ) ) : | |
| 33 | 34 | return; |
| 34 | 35 | endif; |
| 35 | 36 | |
| 36 | -echo $view_args['before_widget']; | |
| 37 | +echo $view_args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 37 | 38 | |
| 38 | -if ( ! empty( $widget_title ) ) : | |
| 39 | - echo $view_args['before_title'] . $widget_title . $view_args['after_title']; | |
| 39 | +if ( ! empty( $charitable_widget_title ) ) : | |
| 40 | + echo $view_args['before_title'] . esc_html( $charitable_widget_title ) . $view_args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 40 | 41 | endif; |
| 41 | 42 | |
| 42 | -$form = new Charitable_Donation_Amount_Form( $campaign ); | |
| 43 | -$form->render(); | |
| 43 | +$charitable_form = new Charitable_Donation_Amount_Form( $charitable_campaign ); | |
| 44 | +$charitable_form->render(); | |
| 44 | 45 | |
| 45 | -echo $view_args['after_widget']; | |
| 46 | +echo $view_args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |