Make WordPress Core

Ticket #40907: apply-widget_text-filter-in-custom-html-widget.diff

File apply-widget_text-filter-in-custom-html-widget.diff, 2.2 KB (added by westonruter, 7 years ago)
  • src/wp-includes/default-filters.php

    diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
    index ada9c53c3f..8f0237028d 100644
    add_filter( 'widget_text_content', 'wptexturize' ); 
    170170add_filter( 'widget_text_content', 'convert_smilies',  20 );
    171171add_filter( 'widget_text_content', 'wpautop'              );
    172172
    173 add_filter( 'widget_custom_html_content', 'balanceTags' );
    174 
    175173add_filter( 'date_i18n', 'wp_maybe_decline_date' );
    176174
    177175// RSS filters
  • src/wp-includes/widgets/class-wp-widget-custom-html.php

    diff --git src/wp-includes/widgets/class-wp-widget-custom-html.php src/wp-includes/widgets/class-wp-widget-custom-html.php
    index 2db50f4d22..5de618285f 100644
    class WP_Widget_Custom_HTML extends WP_Widget { 
    6161                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    6262                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    6363
    64                 $content = $instance['content'];
     64                /** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
     65                $content = apply_filters( 'widget_text', $instance['content'], $instance, $this );
    6566
    6667                /**
    6768                 * Filters the content of the Custom HTML widget.
  • src/wp-includes/widgets/class-wp-widget-text.php

    diff --git src/wp-includes/widgets/class-wp-widget-text.php src/wp-includes/widgets/class-wp-widget-text.php
    index ad4667bb0f..1d4d388bff 100644
    class WP_Widget_Text extends WP_Widget { 
    223223                 * @since 2.3.0
    224224                 * @since 4.4.0 Added the `$this` parameter.
    225225                 *
    226                  * @param string         $text     The widget content.
    227                  * @param array          $instance Array of settings for the current widget.
    228                  * @param WP_Widget_Text $this     Current Text widget instance.
     226                 * @param string                               $text     The widget content.
     227                 * @param array                                $instance Array of settings for the current widget.
     228                 * @param WP_Widget_Text|WP_Widget_Custom_HTML $this     Current Text widget instance.
    229229                 */
    230230                $text = apply_filters( 'widget_text', $text, $instance, $this );
    231231