Make WordPress Core


Ignore:
Timestamp:
07/23/2015 04:49:25 AM (10 years ago)
Author:
pento
Message:

Shortcodes: Improve the reliablity of shortcodes inside HTML tags.

Merge of [33359] to the 4.0 branch.

Props miqrogroove.

See #15694.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0/src/wp-includes/class-wp-embed.php

    r29707 r33381  
    6161
    6262        // Do the shortcode (only the [embed] one is registered)
    63         $content = do_shortcode( $content );
     63        $content = do_shortcode( $content, true );
    6464
    6565        // Put the original shortcodes back
     
    327327     */
    328328    public function autoembed( $content ) {
     329        // Strip newlines from all elements.
     330        $content = wp_replace_in_html_tags( $content, array( "\n" => " " ) );
     331
     332        // Find URLs that are on their own line.
    329333        return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
    330334    }
Note: See TracChangeset for help on using the changeset viewer.