WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/18/17 22:10:41 (6 months ago)
Author:
westonruter
Message:

Widgets: Replace adding balanceTags on widget_custom_html_content filter in favor of just applying widget_text filters in the Custom HTML widget.

Ensures that users who copy HTML from the Text widget in legacy mode over to the Custom HTML widget will continue to get all of the same filters applied, including tag balancing and shortcodes, if a plugin added support. Plugins still have the widget_text_content and widget_custom_html_content filters they can use to target the specific widget types.

Amends [40893].
See #40951.
Fixes #40907 for trunk.

File:
1 edited

Legend:

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

    r41070 r41086  
    214214         * @since 2.3.0 
    215215         * @since 4.4.0 Added the `$this` parameter. 
     216         * @since 4.8.1 The `$this` param may now be a `WP_Widget_Custom_HTML` object in addition to a `WP_Widget_Text` object. 
    216217         * 
    217          * @param string         $text     The widget content. 
    218          * @param array          $instance Array of settings for the current widget. 
    219          * @param WP_Widget_Text $this     Current Text widget instance. 
     218         * @param string                               $text     The widget content. 
     219         * @param array                                $instance Array of settings for the current widget. 
     220         * @param WP_Widget_Text|WP_Widget_Custom_HTML $this     Current Text widget instance. 
    220221         */ 
    221222        $text = apply_filters( 'widget_text', $text, $instance, $this ); 
Note: See TracChangeset for help on using the changeset viewer.