Changeset 33521 for branches/4.1/src/wp-includes/class-wp-embed.php
- Timestamp:
- 07/31/2015 01:42:39 AM (10 years ago)
- File:
-
- 1 edited
-
branches/4.1/src/wp-includes/class-wp-embed.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1/src/wp-includes/class-wp-embed.php
r33380 r33521 313 313 */ 314 314 public function autoembed( $content ) { 315 // Strip newlines from all elements.316 $content = wp_replace_in_html_tags( $content, array( "\n" => " ") );315 // Replace line breaks from all HTML elements with placeholders. 316 $content = wp_replace_in_html_tags( $content, array( "\n" => '<!-- wp-line-break -->' ) ); 317 317 318 318 // Find URLs that are on their own line. 319 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content ); 319 $content = preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content ); 320 321 // Put the line breaks back. 322 return str_replace( '<!-- wp-line-break -->', "\n", $content ); 320 323 } 321 324
Note: See TracChangeset
for help on using the changeset viewer.