← All changes
|
includes/widgets/class-charitable-donation-stats-widget.php
+14
-14
1.7.0
→
1.8.13
View file →
| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Classes/Charitable_Donation_Stats_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. |
| @@ -32,9 +32,9 @@ | ||
| 32 | 32 | parent::__construct( |
| 33 | 33 | 'charitable_donation_stats_widget', |
| 34 | 34 | __( 'Donation Stats', 'charitable' ), |
| 35 | 35 | array( |
| 36 | - 'description' => __( 'Show off your donation statistics.', 'charitable' ), | |
| 36 | + 'description' => __( 'Show off your donation statistics.', 'charitable' ), | |
| 37 | 37 | 'customize_selective_refresh' => true, |
| 38 | 38 | ) |
| 39 | 39 | ); |
| 40 | 40 | } |
| @@ -43,12 +43,12 @@ | ||
| 43 | 43 | * Display the widget contents on the front-end. |
| 44 | 44 | * |
| 45 | 45 | * @since 1.0.0 |
| 46 | 46 | * |
| 47 | - * @param array $args Display arguments including 'before_title', 'after_title', | |
| 47 | + * @param array $args Display arguments including 'before_title', 'after_title', | |
| 48 | 48 | * 'before_widget', and 'after_widget'. |
| 49 | - * @param array $instance The settings for the particular instance of the widget. | |
| 50 | - * @return void | |
| 49 | + * @param array $instance The settings for the particular instance of the widget. | |
| 50 | + * @return void | |
| 51 | 51 | */ |
| 52 | 52 | public function widget( $args, $instance ) { |
| 53 | 53 | $view_args = array_merge( $args, $instance ); |
| 54 | 54 | |
| @@ -70,19 +70,19 @@ | ||
| 70 | 70 | public function form( $instance ) { |
| 71 | 71 | $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; |
| 72 | 72 | ?> |
| 73 | 73 | <p> |
| 74 | - <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'charitable' ); ?></label> | |
| 75 | - <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 ); ?>" /> | |
| 74 | + <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'charitable' ); ?></label> | |
| 75 | + <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 ); ?>" /> | |
| 76 | 76 | </p> |
| 77 | 77 | <?php |
| 78 | 78 | /** |
| 79 | 79 | * Add extra settings for the widget. |
| 80 | 80 | * |
| 81 | - * @since 1.5.0 | |
| 81 | + * @since 1.5.0 | |
| 82 | 82 | * |
| 83 | - * @param array $args Widget instance arguments. | |
| 84 | - * @param Charitable_Donation_Stats_Widget $this This widget instance. | |
| 83 | + * @param array $args Widget instance arguments. | |
| 84 | + * @param Charitable_Donation_Stats_Widget $this This widget instance. | |
| 85 | 85 | */ |
| 86 | 86 | do_action( 'charitable_donation_stats_widget_settings_bottom', $instance, $this ); |
| 87 | 87 | } |
| 88 | 88 | |
| @@ -96,9 +96,9 @@ | ||
| 96 | 96 | * @return array |
| 97 | 97 | */ |
| 98 | 98 | public function update( $new_instance, $old_instance ) { |
| 99 | 99 | $instance = array( |
| 100 | - 'title' => strip_tags( $new_instance['title'] ), | |
| 100 | + 'title' => wp_strip_all_tags( $new_instance['title'] ), | |
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | 104 | * Filter the instance arguments. |
| @@ -106,11 +106,11 @@ | ||
| 106 | 106 | * @since 1.5.0 |
| 107 | 107 | * |
| 108 | 108 | * @param array $instance The parsed instance settings. |
| 109 | 109 | * @param array $new_instance The updated settings. |
| 110 | - * @param array $old_instance The old settings. | |
| 111 | - * @return array | |
| 112 | - */ | |
| 110 | + * @param array $old_instance The old settings. | |
| 111 | + * @return array | |
| 112 | + */ | |
| 113 | 113 | return apply_filters( 'charitable_donation_stats_widget_update_instance', $instance, $new_instance, $old_instance ); |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |