Esoteric Wordpress Fix

I can’t believe I’m going to break my blogging hiatus with an esoteric post on how to fix an annoying error when upgrading to Wordpress 2.5.1.

But, I’m going to…

For those of you who have upgraded Wordpress only to have the following error flash across your screen:

Fatal error: Call to undefined function wp_register_sidebar_widget() in xxxxxxxxx/blog/wp-admin/includes/dashboard.php on line 32

when you try to log into the WP-ADMIN dashboard, there is a simple cure - IF you happen to be using the K2 theme for your blog.

The problem is that earlier versions of K2 used their sidebar system, which required you to disable widgets for Wordpress.  Well, the new admin screen doesn’t like that one bit and it makes it so that you can’t log in.

What’s the cure?  Simple - remove the K2 plugin from the Active Plugins option in the database.

How do you do that?  Log into phpmyadmin and go to the wp_options table and select Browse.  Look for the active_plugins entry (mine was option_id #39) and click the pencil to edit the entry.

The entry will probably look something like this:

a:3:{i:0;s:0:"";i:1;s:19:"akismet/akismet.php";i:2;s:29:"disable-wordpress-widgets.php";}

What you need to do is delete out the disable-wordpress-widgets entry, or it may be named widgets-removal.php or something similar instead.  How do you do this?  Simply remove the quoted call to the php file, and the "i" and "s" entries immediately prior to that call.  So, in my install, the entry above becomes:

a:3:{i:0;s:0:"";i:1;s:19:"akismet/akismet.php";}

It looks much more complicated than it really is.  Once that entry is gone, you can go back to the wp-admin section and log in without a hitch.

As an aside - the latest versions of K2 have a checkbox in their theme options to handle this problem.  To avoid the issue, I’d recommend upgrading K2 first, then upgrading wordpress to 2.5.1.  OR, for those who are reading this prior to the WP 2.5.1 upgrade (if there indeed are any!) - simply use the wp-admin plugin screen to disable the "disable wordpress widgets" plugin before you upgrade.  Then, this will all be a moot point.  :)

I warned you it was esoteric.

Anyway, you can read more here: http://wordpress.org/support/topic/164296

You can also handle this a different way by reading this entry as well.

Technorati Tags , ,

2 comments

1 Kyle { 07.07.08 at 6:07 am }

Awesome! Worked without a hitch!

Thanks!

2 Andrew Milo { 07.07.08 at 11:15 am }

Yay! Glad that it could help someone! :)

Leave a Comment