WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/15/2017 10:35:41 PM (2 years ago)
Author:
westonruter
Message:

Widgets: Ensure return value of widget_text filter is not dropped but passed into widget_text_content filter for rendering.

Amends [40631].
Props vijustin, swissspidy, westonruter.
See #35243.
Fixes #40772.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-text.php

    r40631 r40673  
    6868        $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
    6969
    70         $widget_text = ! empty( $instance['text'] ) ? $instance['text'] : '';
     70        $text = ! empty( $instance['text'] ) ? $instance['text'] : '';
    7171
    7272        /**
     
    7676         * @since 4.4.0 Added the `$this` parameter.
    7777         *
    78          * @param string         $widget_text The widget content.
    79          * @param array          $instance    Array of settings for the current widget.
    80          * @param WP_Widget_Text $this        Current Text widget instance.
     78         * @param string         $text    The widget content.
     79         * @param array          $instance Array of settings for the current widget.
     80         * @param WP_Widget_Text $this     Current Text widget instance.
    8181         */
    82         $text = apply_filters( 'widget_text', $widget_text, $instance, $this );
     82        $text = apply_filters( 'widget_text', $text, $instance, $this );
    8383
    8484        if ( isset( $instance['filter'] ) ) {
     
    9292                 * @since 4.8.0
    9393                 *
    94                  * @param string         $widget_text The widget content.
    95                  * @param array          $instance    Array of settings for the current widget.
    96                  * @param WP_Widget_Text $this        Current Text widget instance.
     94                 * @param string         $text    The widget content.
     95                 * @param array          $instance Array of settings for the current widget.
     96                 * @param WP_Widget_Text $this     Current Text widget instance.
    9797                 */
    98                 $text = apply_filters( 'widget_text_content', $widget_text, $instance, $this );
     98                $text = apply_filters( 'widget_text_content', $text, $instance, $this );
    9999
    100100            } elseif ( $instance['filter'] ) {
Note: See TracChangeset for help on using the changeset viewer.