WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/21/2017 09:01:45 PM (4 years ago)
Author:
westonruter
Message:

Widgets: Include widget_text class name on Custom HTML widget wrapper for theme styling compatibility, in addition to previously-added textwidget class on nested content container.

Amends [40893], [41115].
See #40907.
Fixes #41392 for trunk.

File:
1 edited

Legend:

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

    r41115 r41116  
    7676        $content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );
    7777
     78        // Inject the Text widget's container class name alongside this widget's class name for theme styling compatibility.
     79        $args['before_widget'] = preg_replace( '/(?<=\sclass=["\'])/', 'widget_text ', $args['before_widget'] );
     80
    7881        echo $args['before_widget'];
    7982        if ( ! empty( $title ) ) {
Note: See TracChangeset for help on using the changeset viewer.