From 97e376ca39935dd3963a5cfb0fc25c80a57275d8 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 15 May 2017 22:36:41 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@40673 git-svn-id: http://core.svn.wordpress.org/trunk@40536 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/widgets/class-wp-widget-text.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index ac46369bc3..06cc9e4019 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-beta1-40672'; +$wp_version = '4.8-beta1-40673'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-text.php b/wp-includes/widgets/class-wp-widget-text.php index 434a123f90..b3ffd90b18 100644 --- a/wp-includes/widgets/class-wp-widget-text.php +++ b/wp-includes/widgets/class-wp-widget-text.php @@ -67,7 +67,7 @@ class WP_Widget_Text extends WP_Widget { /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); - $widget_text = ! empty( $instance['text'] ) ? $instance['text'] : ''; + $text = ! empty( $instance['text'] ) ? $instance['text'] : ''; /** * Filters the content of the Text widget. @@ -75,11 +75,11 @@ class WP_Widget_Text extends WP_Widget { * @since 2.3.0 * @since 4.4.0 Added the `$this` parameter. * - * @param string $widget_text The widget content. - * @param array $instance Array of settings for the current widget. - * @param WP_Widget_Text $this Current Text widget instance. + * @param string $text The widget content. + * @param array $instance Array of settings for the current widget. + * @param WP_Widget_Text $this Current Text widget instance. */ - $text = apply_filters( 'widget_text', $widget_text, $instance, $this ); + $text = apply_filters( 'widget_text', $text, $instance, $this ); if ( isset( $instance['filter'] ) ) { if ( 'content' === $instance['filter'] ) { @@ -91,11 +91,11 @@ class WP_Widget_Text extends WP_Widget { * * @since 4.8.0 * - * @param string $widget_text The widget content. - * @param array $instance Array of settings for the current widget. - * @param WP_Widget_Text $this Current Text widget instance. + * @param string $text The widget content. + * @param array $instance Array of settings for the current widget. + * @param WP_Widget_Text $this Current Text widget instance. */ - $text = apply_filters( 'widget_text_content', $widget_text, $instance, $this ); + $text = apply_filters( 'widget_text_content', $text, $instance, $this ); } elseif ( $instance['filter'] ) { $text = wpautop( $text ); // Back-compat for instances prior to 4.8.