Hi,
I’ve just found the solution. The code is
function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
global $wp_embed;
$wp_embed->register_handler( $id, $regex, $callback, $priority );
}
so i’ve just add some line like this
function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
global $wp_embed;
if ($wp_embed)
$wp_embed->register_handler( $id, $regex, $callback, $priority );
}
And its done.
Oyea, note that this happend when I upgrade wordpress from 3.4 to 3.5
@exblopz
Adding that if statement fixed mine. Thanks!
The question is, why does it need to be in there?
well,
I checked out that register_handler doesn’t set in variable $wp_embed. This occured maybe because I update wordpress manually by FTP. I did this because admin doesn’t allow me to upgrade inside wordpress dashboard.
Maybe some file is missing.
I figured this out. It looks like it was this patch that is causing the conflict:
http://core.trac.wordpress.org/attachment/ticket/20533/20533.patch
What fixed it correctly for me was to add the following line to wp-settings.php (just the line, not my “<<<< add this” annotation below):
require( ABSPATH . WPINC . ‘/update.php’ );
require( ABSPATH . WPINC . ‘/canonical.php’ );
require( ABSPATH . WPINC . ‘/shortcodes.php’ );
require( ABSPATH . WPINC . ‘/class-wp-embed.php’ ); <<<< add this
require( ABSPATH . WPINC . ‘/media.php’ );
require( ABSPATH . WPINC . ‘/http.php’ );
require( ABSPATH . WPINC . ‘/class-http.php’ );
For me, this was for an SVN upgrade. If you’re not using SVN, you can manually edit the above file and stop. If you’re using SVN and want more info on how to handle this via SVN, read on.
The bigger issue I figured out is that wp-settings.php had a SVN conflict that never got resolved several updates ago:
$ svn info wp-settings.php
Path: wp-settings.php
Name: wp-settings.php
URL: http://core.svn.wordpress.org/tags/3.1.2/wp-settings.php
Repository Root: http://core.svn.wordpress.org
Repository UUID: 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Revision: 21100
Node Kind: file
Schedule: normal
Last Changed Author: ryan
Last Changed Rev: 16558
Last Changed Date: 2010-11-23 16:19:38 -0800 (Tue, 23 Nov 2010)
Checksum: 4d75ac52c641f9b5ec7165b700aecc5e
Conflict Previous Base File: wp-settings.php.r15930
Conflict Previous Working File: wp-settings.php.mine
Conflict Current Base File: wp-settings.php.r17841
I don’t use SVN much, so there may be better ways to resolve this, but what I did was:
cp wp-settings.php wp-settings.php.hold
svn remove –force wp-settings.php
svn up wp-settings.php
You can do a “diff -C 5 wp-settings.php.hold wp-settings.php” then to see what the changes were between your version and the repository’s one that you just updated to.
Thank you VERY MUCH, mjm22178!
It worked for me!
brilliant!!thank you – hours of time were rewarded with your elegant solution
@exblopz
Wow! Your solution worked! I updated to 3.5.1 manually and got the same error. Struggled with this for days until I found the right fix. Thanks.
Here’s a shout out for the following resolution from
rusmanarief
Member Posted 3 months ago #
1. go to wp-includes/default-filters.php line 248
2. comment that line
add_action( ‘plugins_loaded’, ‘wp_maybe_load_embeds’, 0 );
I did comment out the above which then allowed me to get into the admin panel. Then I renamed the plugins folder to do a mass disable of the plugins. Then I did a reinstall of WP 3.5.1 from the Admin panel, updated the themes, renamed the plugins folder back to plugins, and updated all plugins. It worked where nothing else seemed to work.
Also, by reinstalling 3.5.1 from the admin panel it also rewrote the default-filters.php file back to the standard so it no longer has the commented line.