- Timestamp:
- 07/18/2017 04:20:17 AM (8 years ago)
- Location:
- branches/4.8
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/widgets/class-wp-widget-text.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8
-
branches/4.8/src/wp-includes/widgets/class-wp-widget-text.php
r41053 r41071 96 96 97 97 $wpautop = ! empty( $instance['filter'] ); 98 $has_line_breaks = ( false !== strpos( $instance['text'], "\n" ) );98 $has_line_breaks = ( false !== strpos( trim( $instance['text'] ), "\n" ) ); 99 99 100 100 // If auto-paragraphs are not enabled and there are line breaks, then ensure legacy mode. … … 105 105 // If an HTML comment is present, assume legacy mode. 106 106 if ( false !== strpos( $instance['text'], '<!--' ) ) { 107 return true;108 }109 110 /*111 * If a shortcode is present (with support added by a plugin), assume legacy mode112 * since shortcodes would apply at the widget_text filter and thus be applied113 * before wpautop runs at the widget_text_content filter.114 */115 if ( preg_match( '/' . get_shortcode_regex() . '/', $instance['text'] ) ) {116 107 return true; 117 108 } … … 349 340 </p> 350 341 <div class="notice inline notice-info notice-alt"> 351 <p><?php _e( 'This widget containscode that may work better in the new “Custom HTML” widget. How about trying that widget instead?' ); ?></p>342 <p><?php _e( 'This widget may contain code that may work better in the new “Custom HTML” widget. How about trying that widget instead?' ); ?></p> 352 343 </div> 353 344 <p>
Note: See TracChangeset
for help on using the changeset viewer.