Fatal error in media.php on line 953 or menu.php

Recently one of my clients performed an upgrade to WordPress 3.5.1.  Unfortunately, the upgrade failed for some reason and they were locked out of the Admin panel with an error about undefined function get_taxonomies_for_attachments in menu.php.  Research of the web produced the suggestion to manually reinstall all the WordPress 3.5.1 files.

Doing that manual installation, I then received an error about a Fatal error: Call to a member function register_handler() on a non-object in /home/simplete/public_html/wp-includes/media.php on line 953.  No combination of moving files, reinstalling various versions, or other tricks seemed to work for me.

Then I found a post from rusmanarief in this thead WordPress Support  WordPress 3.5 – Error on Line 944 that provided me the clue that I needed to resolve the problem.

Here’s what I did:

1. go to wp-includes/default-filters.php line 248
2. comment out the line:  add_action( ‘plugins_loaded’, ‘wp_maybe_load_embeds’, 0 );

After I commented out the above that allowed me to get into the admin panel. Then I renamed the plugins folder to plugins-hold 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-hold 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.

Leave a Comment