Skip to:
Content

BuddyPress.org

Ticket #6778: 6778.02.patch

File 6778.02.patch, 1.3 KB (added by imath, 8 years ago)
  • src/bp-core/classes/class-bp-embed.php

    diff --git src/bp-core/classes/class-bp-embed.php src/bp-core/classes/class-bp-embed.php
    index 2ffcc15..d15af95 100644
    class BP_Embed extends WP_Embed { 
    126126                 */
    127127                $id = apply_filters( 'embed_post_id', 0 );
    128128
     129                $unfiltered_html   = current_user_can( 'unfiltered_html' );
     130                $default_discovery = false;
     131
     132                // Since 4.4, WordPress is now an oEmbed provider.
     133                if ( function_exists( 'wp_oembed_register_route' ) ) {
     134                        $unfiltered_html   = true;
     135                        $default_discovery = true;
     136                }
     137
    129138                /**
    130139                 * Filters whether or not oEmbed discovery is on.
    131140                 *
    132141                 * @since 1.5.0
     142                 * @since 2.5.0 Default status of oEmbed discovery has been switched
     143                 *              to true to apply changes introduced in WordPress 4.4
    133144                 *
    134                  * @param bool $value Current status of oEmbed discovery.
     145                 * @param bool $default_discovery Current status of oEmbed discovery.
    135146                 */
    136                 $attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', false ) && current_user_can( 'unfiltered_html' ) );
     147                $attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', $default_discovery ) && $unfiltered_html );
    137148
    138149                // Set up a new WP oEmbed object to check URL with registered oEmbed providers.
    139150                require_once( ABSPATH . WPINC . '/class-oembed.php' );