~canonical-sysadmins/wordpress/4.6.1

« back to all changes in this revision

Viewing changes to wp-includes/widgets/class-wp-widget-text.php

  • Committer: Nick Moffitt
  • Date: 2016-04-14 10:44:19 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: nick.moffitt@canonical.com-20160414104419-w6lxcr3ru4enc2w5
Merge WP4.5 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
         * @access public
24
24
         */
25
25
        public function __construct() {
26
 
                $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML.'));
27
 
                $control_ops = array('width' => 400, 'height' => 350);
28
 
                parent::__construct('text', __('Text'), $widget_ops, $control_ops);
 
26
                $widget_ops = array(
 
27
                        'classname' => 'widget_text',
 
28
                        'description' => __( 'Arbitrary text or HTML.' ),
 
29
                        'customize_selective_refresh' => true,
 
30
                );
 
31
                $control_ops = array( 'width' => 400, 'height' => 350 );
 
32
                parent::__construct( 'text', __( 'Text' ), $widget_ops, $control_ops );
29
33
        }
30
34
 
31
35
        /**
80
84
        public function update( $new_instance, $old_instance ) {
81
85
                $instance = $old_instance;
82
86
                $instance['title'] = sanitize_text_field( $new_instance['title'] );
83
 
                if ( current_user_can('unfiltered_html') )
84
 
                        $instance['text'] =  $new_instance['text'];
85
 
                else
86
 
                        $instance['text'] = wp_kses_post( stripslashes( $new_instance['text'] ) );
 
87
                if ( current_user_can( 'unfiltered_html' ) ) {
 
88
                        $instance['text'] = $new_instance['text'];
 
89
                } else {
 
90
                        $instance['text'] = wp_kses_post( $new_instance['text'] );
 
91
                }
87
92
                $instance['filter'] = ! empty( $new_instance['filter'] );
88
93
                return $instance;
89
94
        }