Make WordPress Core


Ignore:
Timestamp:
10/07/2015 10:35:18 AM (9 years ago)
Author:
pento
Message:

Embeds: Add oEmbed provider support.

For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.

In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.

For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.

Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia

Fixes #32522.

File:
1 edited

Legend:

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

    r33734 r34903  
    234234             *
    235235             * @since 2.9.0
     236             * @since 4.4.0 The default value changed to true.
    236237             *
    237238             * @see WP_oEmbed::discover()
    238239             *
    239              * @param bool $enable Whether to enable `<link>` tag discovery. Default false.
     240             * @param bool $enable Whether to enable `<link>` tag discovery. Default true.
    240241             */
    241             $attr['discover'] = ( apply_filters( 'embed_oembed_discover', false ) && author_can( $post_ID, 'unfiltered_html' ) );
     242            $attr['discover'] = ( apply_filters( 'embed_oembed_discover', true ) );
    242243
    243244            // Use oEmbed to get the HTML
Note: See TracChangeset for help on using the changeset viewer.