PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
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 1.7.0.9 All 211 releases
← All changes | includes/widgets/class-charitable-donate-widget.php +11 -12 1.7.0.14 → 1.8.13 View file →
@@ -4,9 +4,9 @@
4 4 *
5 5 * @package Charitable/Classes/Charitable_Donate_Widget
6 6 * @version 1.0.0
7 7 * @author David Bisset
8 - * @copyright Copyright (c) 2022, WP Charitable LLC
8 + * @copyright Copyright (c) 2023, WP Charitable LLC
9 9 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10 10 */
11 11
12 12 // Exit if accessed directly.
@@ -34,13 +34,12 @@
34 34 parent::__construct(
35 35 'charitable_donate_widget',
36 36 __( 'Campaign Donation', 'charitable' ),
37 37 array(
38 - 'description' => __( 'Display a donation widget.', 'charitable' ),
38 + 'description' => __( 'Display a donation widget.', 'charitable' ),
39 39 'customize_selective_refresh' => true,
40 40 )
41 41 );
42 -
43 42 }
44 43
45 44 /**
46 45 * Displays the widget on the frontend.
@@ -46,14 +45,14 @@
46 45 * Displays the widget on the frontend.
47 46 *
48 47 * @since 1.0.0
49 48 *
50 - * @param array $args Widget args.
49 + * @param array $args Widget args.
51 50 * @param array $instance Widget instance.
52 51 * @return void
53 52 */
54 53 public function widget( $args, $instance ) {
55 - if ( ! array_key_exists( 'campaign_id', $instance ) || '' == $instance['campaign_id'] ) {
54 + if ( ! array_key_exists( 'campaign_id', $instance ) || '' === $instance['campaign_id'] ) {
56 55 return;
57 56 }
58 57
59 58 charitable_template( 'widgets/donate.php', array_merge( $args, $instance ) );
@@ -79,19 +78,19 @@
79 78 $campaign_id = $instance['campaign_id'];
80 79 $campaigns = Charitable_Campaigns::query( array( 'posts_per_page' => -1 ) );
81 80 ?>
82 81 <p>
83 - <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'charitable' ) ?>
84 - <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
82 + <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'charitable' ); ?>
83 + <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
85 84 </label>
86 85 </p>
87 86 <p>
88 - <label for="<?php echo $this->get_field_id( 'campaign_id' ); ?>"><?php _e( 'Campaign:', 'charitable' ) ?>
89 - <select name="<?php echo $this->get_field_name( 'campaign_id' ) ?>">
90 - <option value="current"><?php _e( 'Campaign currently viewed', 'charitable' ) ?></option>
91 - <optgroup label="<?php _e( 'Specific campaigns', 'charitable' ) ?>">
87 + <label for="<?php echo esc_attr( $this->get_field_id( 'campaign_id' ) ); ?>"><?php esc_html_e( 'Campaign:', 'charitable' ); ?>
88 + <select name="<?php echo esc_attr( $this->get_field_name( 'campaign_id' ) ); ?>">
89 + <option value="current"><?php esc_html_e( 'Campaign currently viewed', 'charitable' ); ?></option>
90 + <optgroup label="<?php esc_html_e( 'Specific campaigns', 'charitable' ); ?>">
92 91 <?php foreach ( $campaigns->posts as $campaign ) : ?>
93 - <option value="<?php echo $campaign->ID ?>" <?php selected( $campaign->ID, $campaign_id ) ?>><?php echo $campaign->post_title ?></option>
92 + <option value="<?php echo esc_attr( $campaign->ID ); ?>" <?php selected( $campaign->ID, $campaign_id ); ?>><?php echo esc_html( $campaign->post_title ); ?></option>
94 93 <?php endforeach ?>
95 94 </optgroup>
96 95 </select>
97 96 </label>