mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@41115 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -79,7 +79,9 @@ class WP_Widget_Custom_HTML extends WP_Widget {
|
||||
if ( ! empty( $title ) ) {
|
||||
echo $args['before_title'] . $title . $args['after_title'];
|
||||
}
|
||||
echo '<div class="textwidget custom-html-widget">'; // The textwidget class is for theme styling compatibility.
|
||||
echo $content;
|
||||
echo '</div>';
|
||||
echo $args['after_widget'];
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ class Test_WP_Widget_Custom_HTML extends WP_UnitTestCase {
|
||||
$this->assertNotEmpty( $this->widget_custom_html_content_args );
|
||||
$this->assertNotEmpty( $this->widget_text_args );
|
||||
$this->assertContains( '[filter:widget_text][filter:widget_custom_html_content]', $output );
|
||||
$this->assertContains( '<div class="textwidget custom-html-widget">', $output );
|
||||
$this->assertNotContains( '<p>', $output );
|
||||
$this->assertNotContains( '<br>', $output );
|
||||
$this->assertNotContains( '</u>', $output );
|
||||
|
||||
Reference in New Issue
Block a user