__( 'Show off your donation statistics.', 'charitable' ), 'customize_selective_refresh' => true, ) ); } /** * Display the widget contents on the front-end. * * @since 1.0.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance The settings for the particular instance of the widget. * @return void */ public function widget( $args, $instance ) { $view_args = array_merge( $args, $instance ); if ( ! array_key_exists( 'title', $view_args ) ) { $view_args['title'] = __( 'Donation Statistics', 'charitable' ); } charitable_template( 'widgets/donation-stats.php', $view_args ); } /** * Display the widget form in the admin. * * @since 1.0.0 * * @param array $instance The current settings for the widget options. * @return void */ public function form( $instance ) { $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>
wp_strip_all_tags( $new_instance['title'] ), ); /** * Filter the instance arguments. * * @since 1.5.0 * * @param array $instance The parsed instance settings. * @param array $new_instance The updated settings. * @param array $old_instance The old settings. * @return array */ return apply_filters( 'charitable_donation_stats_widget_update_instance', $instance, $new_instance, $old_instance ); } } endif;