X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0459461f9ea42e0b090759ff6fe5f48360bef750..refs/tags/wordpress-4.5:/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..a8ec3d4f 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 ); } /** @@ -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; }