WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/23/2015 05:00:44 AM (6 years ago)
Author:
pento
Message:

Shortcodes: Improve the reliablity of shortcodes inside HTML tags.

Merge of [33359] to the 3.9 branch.

Props miqrogroove.

See #15694.

File:
1 edited

Legend:

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

    r28083 r33386  
    5858
    5959        // Do the shortcode (only the [embed] one is registered)
    60         $content = do_shortcode( $content );
     60        $content = do_shortcode( $content, true );
    6161
    6262        // Put the original shortcodes back
     
    292292     */
    293293    function autoembed( $content ) {
     294        // Strip newlines from all elements.
     295        $content = wp_replace_in_html_tags( $content, array( "\n" => " " ) );
     296
     297        // Find URLs that are on their own line.
    294298        return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
    295299    }
Note: See TracChangeset for help on using the changeset viewer.