Changeset 33469 for trunk/src/wp-includes/class-wp-embed.php
- Timestamp:
- 07/28/2015 11:02:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-embed.php
r33359 r33469 130 130 */ 131 131 public function shortcode( $attr, $url = '' ) { 132 // This filter can be used to output custom HTML instead of allowing oEmbed to run. 133 $custom = apply_filters( 'wp_embed_shortcode_custom', false, $attr, $url ); 134 if ( false !== $custom ) { 135 return $custom; 136 } 137 132 138 $post = get_post(); 133 139 … … 319 325 */ 320 326 public function autoembed( $content ) { 321 // Strip newlines from all elements.322 $content = wp_replace_in_html_tags( $content, array( "\n" => " ") );327 // Replace line breaks from all HTML elements with placeholders. 328 $content = wp_replace_in_html_tags( $content, array( "\n" => '<!-- wp-line-break -->' ) ); 323 329 324 330 // Find URLs that are on their own line. 325 return preg_replace_callback( '|^(\s*)(https?://[^\s"]+)(\s*)$|im', array( $this, 'autoembed_callback' ), $content ); 331 $content = preg_replace_callback( '|^(\s*)(https?://[^\s"]+)(\s*)$|im', array( $this, 'autoembed_callback' ), $content ); 332 333 // Put the line breaks back. 334 return str_replace( '<!-- wp-line-break -->', "\n", $content ); 326 335 } 327 336
Note: See TracChangeset
for help on using the changeset viewer.