diff --git a/src/wp-includes/widgets/class-wp-widget-custom-html.php b/src/wp-includes/widgets/class-wp-widget-custom-html.php index 5de618285f..7447415185 100644 --- a/src/wp-includes/widgets/class-wp-widget-custom-html.php +++ b/src/wp-includes/widgets/class-wp-widget-custom-html.php @@ -79,7 +79,9 @@ class WP_Widget_Custom_HTML extends WP_Widget { if ( ! empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } + echo '
'; // The textwidget class is for theme styling compatibility. echo $content; + echo '
'; echo $args['after_widget']; } diff --git a/tests/phpunit/tests/widgets/custom-html-widget.php b/tests/phpunit/tests/widgets/custom-html-widget.php index c7c2e91bf8..a9fe7c33cb 100644 --- a/tests/phpunit/tests/widgets/custom-html-widget.php +++ b/tests/phpunit/tests/widgets/custom-html-widget.php @@ -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( '
', $output ); $this->assertNotContains( '

', $output ); $this->assertNotContains( '
', $output ); $this->assertNotContains( '', $output );