WordPress.org

Make WordPress Core

Changeset 41115


Ignore:
Timestamp:
07/21/2017 06:12:43 PM (2 years ago)
Author:
westonruter
Message:

Widgets: Improve theme styling compatibility for Custom HTML widget by adding container with textwidget class.

The same styling from the Text widget should apply to the Custom HTML widget since users are expected to copy HTML from the (legacy) Text widget into the latter.

Amends [40893].
See #40907.
Fixes #41392.

Location:
trunk
Files:
2 edited

Legend:

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

    r41086 r41115  
    8080            echo $args['before_title'] . $title . $args['after_title'];
    8181        }
     82        echo '<div class="textwidget custom-html-widget">'; // The textwidget class is for theme styling compatibility.
    8283        echo $content;
     84        echo '</div>';
    8385        echo $args['after_widget'];
    8486    }
  • trunk/tests/phpunit/tests/widgets/custom-html-widget.php

    r41086 r41115  
    7171        $this->assertNotEmpty( $this->widget_text_args );
    7272        $this->assertContains( '[filter:widget_text][filter:widget_custom_html_content]', $output );
     73        $this->assertContains( '<div class="textwidget custom-html-widget">', $output );
    7374        $this->assertNotContains( '<p>', $output );
    7475        $this->assertNotContains( '<br>', $output );
Note: See TracChangeset for help on using the changeset viewer.