Skip to:
Content

BuddyPress.org

Changeset 12414


Ignore:
Timestamp:
07/25/2019 11:30:59 AM (4 months ago)
Author:
imath
Message:

BP Embeds: anticipate a deprecated notice to be introduced in WP 5.3.0

WordPress 5.3.0 has moved the WP_oEmbed class we are using into BP Embeds into a new file, deprecating the older one. To be ready for this next major version of WordPress we are now checking for this new file path to eventually use it if it exists and keeping on using the older one for previous version of WordPress if it is not the case.

Fixes #8115

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-embed.php

    r11763 r12414  
    139139
    140140        // Set up a new WP oEmbed object to check URL with registered oEmbed providers.
    141         require_once( ABSPATH . WPINC . '/class-oembed.php' );
     141        if ( file_exists( ABSPATH . WPINC . '/class-wp-oembed.php' ) ) {
     142            require_once( ABSPATH . WPINC . '/class-wp-oembed.php' );
     143        } else {
     144            // class-oembed.php is deprecated in WordPress 5.3.0.
     145            require_once( ABSPATH . WPINC . '/class-oembed.php' );
     146        }
     147
    142148        $oembed_obj = _wp_oembed_get_object();
    143149
Note: See TracChangeset for help on using the changeset viewer.