mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02:00
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
This commit is contained in:
parent
66d3a486f6
commit
97e376ca39
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
@ -67,7 +67,7 @@ class WP_Widget_Text extends WP_Widget {
|
|||||||
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
|
/** 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 );
|
$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.
|
* Filters the content of the Text widget.
|
||||||
@ -75,11 +75,11 @@ class WP_Widget_Text extends WP_Widget {
|
|||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
* @since 4.4.0 Added the `$this` parameter.
|
* @since 4.4.0 Added the `$this` parameter.
|
||||||
*
|
*
|
||||||
* @param string $widget_text The widget content.
|
* @param string $text The widget content.
|
||||||
* @param array $instance Array of settings for the current widget.
|
* @param array $instance Array of settings for the current widget.
|
||||||
* @param WP_Widget_Text $this Current Text widget instance.
|
* @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 ( isset( $instance['filter'] ) ) {
|
||||||
if ( 'content' === $instance['filter'] ) {
|
if ( 'content' === $instance['filter'] ) {
|
||||||
@ -91,11 +91,11 @@ class WP_Widget_Text extends WP_Widget {
|
|||||||
*
|
*
|
||||||
* @since 4.8.0
|
* @since 4.8.0
|
||||||
*
|
*
|
||||||
* @param string $widget_text The widget content.
|
* @param string $text The widget content.
|
||||||
* @param array $instance Array of settings for the current widget.
|
* @param array $instance Array of settings for the current widget.
|
||||||
* @param WP_Widget_Text $this Current Text widget instance.
|
* @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'] ) {
|
} elseif ( $instance['filter'] ) {
|
||||||
$text = wpautop( $text ); // Back-compat for instances prior to 4.8.
|
$text = wpautop( $text ); // Back-compat for instances prior to 4.8.
|
||||||
|
Loading…
Reference in New Issue
Block a user