Changeset 41117
- Timestamp:
- 07/21/2017 09:16:58 PM (7 years ago)
- Location:
- branches/4.8
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8
- Property svn:mergeinfo changed
/trunk merged: 41115-41116
- Property svn:mergeinfo changed
-
branches/4.8/src/wp-includes/default-widgets.php
r41087 r41117 134 134 $content = apply_filters( 'widget_custom_html_content', $content, $instance, $this ); 135 135 136 // Inject the Text widget's container class name alongside this widget's class name for theme styling compatibility. 137 $args['before_widget'] = preg_replace( '/(?<=\sclass=["\'])/', 'widget_text ', $args['before_widget'] ); 138 136 139 echo $args['before_widget']; 137 140 if ( ! empty( $title ) ) { 138 141 echo $args['before_title'] . $title . $args['after_title']; 139 142 } 143 echo '<div class="textwidget custom-html-widget">'; // The textwidget class is for theme styling compatibility. 140 144 echo $content; 145 echo '</div>'; 141 146 echo $args['after_widget']; 142 147 } -
branches/4.8/tests/phpunit/tests/widgets/custom-html-widget.php
r41087 r41117 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( '<section id="custom_html-5" class="widget_text widget widget_custom_html">', $output ); 74 $this->assertContains( '<div class="textwidget custom-html-widget">', $output ); 73 75 $this->assertNotContains( '<p>', $output ); 74 76 $this->assertNotContains( '<br>', $output );
Note: See TracChangeset
for help on using the changeset viewer.