Tag Archive for 'fatal error'

Fatal error: Call to undefined function wp_register_sidebar_widget() in…

Beware if you update to WordPress 2.5 and are using the very popular K2 theme.

If you are using K2 and you do update to 2.5, you will receive the following error on trying to browse to your WordPress dashboard:

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

A bit of research told me that this is because K2 turns off WordPress widgets in favour of its own widget manager and as 2.5 has started to widgetize the Dashboard, you get this error.

To fix the error:
navigate to your K2 folder -> app -> includes
edit the file widgets-removal.php as below

Change the contents of the file from:

< ?php
if (get_option('k2sidebarmanager') == '1') {
	remove_action('plugins_loaded', 'wp_maybe_load_widgets', 0);
}
?>

to

< ?php
if (get_option('k2sidebarmanager') == '1') {
	remove_action('plugins_loaded', 'wp_maybe_load_widgets', 0);
  if( is_admin() )
	{global $pagenow; if( $pagenow == 'index.php' ) wp_maybe_load_widgets();
}
}
?>

Your dashboard should now be browsable once more!

I knew I should have held off on updating longer. I blame Donncha!




Tom Raftery’s Social Media is Digg proof thanks to caching by WP Super Cache!