Make WordPress Core

Ticket #24605: 24605.diff

File 24605.diff, 1.3 KB (added by DrewAPicture, 9 years ago)
  • src/wp-includes/widgets/class-wp-widget-text.php

     
    3030                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    3131                $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
    3232
     33                $widget_text = ! empty( $instance['text'] ) ? $instance['text'] : '';
     34
    3335                /**
    3436                 * Filter the content of the Text widget.
    3537                 *
    3638                 * @since 2.3.0
     39                 * @since 4.4.0 Added the `$this` parameter.
    3740                 *
    38                  * @param string    $widget_text The widget content.
    39                  * @param WP_Widget $instance    WP_Widget instance.
     41                 * @param string         $widget_text The widget content.
     42                 * @param array          $instance    Array of settings for the current widget.
     43                 * @param WP_Widget_Text $this        Current Text widget instance.
    4044                 */
    41                 $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance );
     45                $text = apply_filters( 'widget_text', $widget_text, $instance, $this );
     46
    4247                echo $args['before_widget'];
    4348                if ( ! empty( $title ) ) {
    4449                        echo $args['before_title'] . $title . $args['after_title'];