Make WordPress Core


Ignore:
Timestamp:
07/21/2017 09:16:58 PM (8 years ago)
Author:
westonruter
Message:

Widgets: Improve theme styling compatibility for Custom HTML widget by adding content container with textwidget class and widget_text class on widget wrapper element.

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.

Merges [41115] and partially [41116] onto 4.8 branch.
Amends [40893].
See #40907.
Fixes #41392 for 4.8.1.

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

  • branches/4.8/tests/phpunit/tests/widgets/custom-html-widget.php

    r41087 r41117  
    5252            'before_title'  => '<h2>',
    5353            'after_title'   => "</h2>\n",
    54             'before_widget' => '<section>',
     54            'before_widget' => '<section id="custom_html-5" class="widget widget_custom_html">',
    5555            'after_widget'  => "</section>\n",
    5656        );
     
    7171        $this->assertNotEmpty( $this->widget_text_args );
    7272        $this->assertContains( '[filter:widget_text][filter:widget_custom_html_content]', $output );
     73        $this->assertContains( '<section id="custom_html-5" class="widget_text widget widget_custom_html">', $output );
     74        $this->assertContains( '<div class="textwidget custom-html-widget">', $output );
    7375        $this->assertNotContains( '<p>', $output );
    7476        $this->assertNotContains( '<br>', $output );
Note: See TracChangeset for help on using the changeset viewer.