Changeset 41116
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-custom-html.php
r41115 r41116 76 76 $content = apply_filters( 'widget_custom_html_content', $content, $instance, $this ); 77 77 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 78 81 echo $args['before_widget']; 79 82 if ( ! empty( $title ) ) { -
trunk/tests/phpunit/tests/widgets/custom-html-widget.php
r41115 r41116 52 52 'before_title' => '<h2>', 53 53 'after_title' => "</h2>\n", 54 'before_widget' => '<section >',54 'before_widget' => '<section id="custom_html-5" class="widget widget_custom_html">', 55 55 'after_widget' => "</section>\n", 56 56 ); … … 71 71 $this->assertNotEmpty( $this->widget_text_args ); 72 72 $this->assertContains( '[filter:widget_text][filter:widget_custom_html_content]', $output ); 73 $this->assertContains( '<div class="textwidget custom-html-widget">', $output ); 73 $this->assertContains( '<section id="custom_html-5" class="widget_text widget widget_custom_html">', $output ); 74 $this->assertContains( 'class="widget_text widget widget_custom_html"', $output ); 74 75 $this->assertNotContains( '<p>', $output ); 75 76 $this->assertNotContains( '<br>', $output );
Note: See TracChangeset
for help on using the changeset viewer.