PHP Fatal error: Cannot redeclare _wp_oembed_get_object() (previously declared in /home/samdonme/public_html/wp-includes/embed.php:112) in /home/samdonme/public_html/wp-includes/class-oembed.php on line 692


function _wp_oembed_get_object() {
    static $wp_oembed = null;

oembed.php on line 692

function _wp_oembed_get_object() {
    static $wp_oembed = null;

    if ( is_null( $wp_oembed ) ) {
        $wp_oembed = new WP_oEmbed();
    return $wp_oembed;

As you see above, I am have problem with the embed.php and class-oembed.php. When I delete form setting.php

require( ABSPATH . WPINC . '/class-oembed.php' );

problem is fixed. But I want to learn how can I fix "_wp_oembed_get_object()" problem

  • the both files should be there in WordPress – prosti Dec 7 '16 at 18:34
  • have this any connection with new WordPres version 4.7? – prosti Dec 7 '16 at 18:35

The function _wp_oembed_get_object was moved from class-oembed.php to embed.php a while back - your best bet is to reinstall WordPress.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.