X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..607b7e02d77e7326161e8ec15639052d2040f745:/wp-includes/widgets/class-wp-widget-text.php diff --git a/wp-includes/widgets/class-wp-widget-text.php b/wp-includes/widgets/class-wp-widget-text.php index 96cf6429..a379fd71 100644 --- a/wp-includes/widgets/class-wp-widget-text.php +++ b/wp-includes/widgets/class-wp-widget-text.php @@ -23,9 +23,13 @@ class WP_Widget_Text extends WP_Widget { * @access public */ public function __construct() { - $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML.')); - $control_ops = array('width' => 400, 'height' => 350); - parent::__construct('text', __('Text'), $widget_ops, $control_ops); + $widget_ops = array( + 'classname' => 'widget_text', + 'description' => __( 'Arbitrary text or HTML.' ), + 'customize_selective_refresh' => true, + ); + $control_ops = array( 'width' => 400, 'height' => 350 ); + parent::__construct( 'text', __( 'Text' ), $widget_ops, $control_ops ); } /** @@ -46,7 +50,7 @@ class WP_Widget_Text extends WP_Widget { $widget_text = ! empty( $instance['text'] ) ? $instance['text'] : ''; /** - * Filter the content of the Text widget. + * Filters the content of the Text widget. * * @since 2.3.0 * @since 4.4.0 Added the `$this` parameter. @@ -80,10 +84,11 @@ class WP_Widget_Text extends WP_Widget { public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = sanitize_text_field( $new_instance['title'] ); - if ( current_user_can('unfiltered_html') ) - $instance['text'] = $new_instance['text']; - else - $instance['text'] = wp_kses_post( stripslashes( $new_instance['text'] ) ); + if ( current_user_can( 'unfiltered_html' ) ) { + $instance['text'] = $new_instance['text']; + } else { + $instance['text'] = wp_kses_post( $new_instance['text'] ); + } $instance['filter'] = ! empty( $new_instance['filter'] ); return $instance; }