Forums

Call to undefined function wp_register_sidebar_widget (WP 2.5) (22 posts)

  1. ponchito147
    Member
    Posted 1 month ago #

    I have just upgraded my wordpress blog 2.3.2 to the 2.5, and when I go to the admin dashboard (after upgrading the database [wp-admin/upgrade.php], of course) I get this error:

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

    -I did deactivate the plugins
    -I did make a backup of my database
    -I did delete all the 2.3.2 files in my server (except for wp-config.php, an .htaccess and the wp-content)
    My blog front is working fine !

    I uploadead the 2.5 files twice, to see if there was a file missing.

  2. mortega
    Member
    Posted 1 month ago #

    Are you using the K2 theme? Because that happened to me and I was using one of the variations of K2.

  3. ponchito147
    Member
    Posted 1 month ago #

    Yes, I'm using the K2 RC3.

    What did you do to resolve this ? I only renamed the K2 folder to K2. and it works fine now.

    Thank you for your help !

  4. haxorjoe
    Member
    Posted 1 month ago #

    Is there a fix for this yet? I rely on K2 for my theme and don't really have an alternative.

  5. ponchito147
    Member
    Posted 1 month ago #

    haxorjoe, I don“t thing there is a fix yet. I would have to be made by the K2 developers. But as I already said, I only renamed the /k2/ to /k2./ and it worked.

  6. nicrox
    Member
    Posted 1 month ago #

    same problem. i renamed k2 to k2. and went to the home page and it was blank. what is the proper way to rename?

    www.theroxyonsunset.com

  7. nick58b
    Member
    Posted 1 month ago #

    I downloaded K2 RC4, copied the new files over the old RC3 ones, and it appears to have fixed the error for me.

    http://getk2.com/download/

  8. haxorjoe
    Member
    Posted 1 month ago #

    Never mind, works now.

  9. ponchito147
    Member
    Posted 1 month ago #

    I downloaded K2 RC4, copied the new files over the old RC3 ones, and it appears to have fixed the error for me.

    Yes !!!, that works too.

  10. dhergert
    Member
    Posted 1 month ago #

    Downloading and installing RC4 did not work for me. I then got this error:
    Call to undefined function: wp_bootstrap()

    So searching led me to believe I should blow away my entire K2 directory and start fresh, which I did. But still had issues. Turns out, I believe it had to do with the 'active plugins' setting in the database.

    I removed the entry "../themes/k2/app/includes/widgets-removal.php" from the active_plugins row in the database "options" table. Geez!

  11. abadr
    Member
    Posted 1 month ago #

    dhergert - thank you so much. that worked a treat!

    ah... upgrading, how I love it.

  12. Tibor
    Member
    Posted 1 month ago #

    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();
    }
    }
    ?>

    Many thanks to Tom Raferty!

  13. journeyguy
    Member
    Posted 1 month ago #

    I don't use K2 as a theme and still got that error. Now I can't get access to my dashboard... Help!

  14. Tibor
    Member
    Posted 1 month ago #

    @journeyguy: what theme are you using then? Does it have a sidebar manager of it's own, or something like that?

    And are you able to access the other admin pages? (as in: www.yourdomain.com/wp-admin/plugins.php).

  15. dmchale
    Member
    Posted 1 month ago #

    Tibor, thanks tons for that post. It worked like a dream. I was already using k2 rc4 so I was kind of at a loss. i had disabled all plugins and reverted my blog to default theme before going from 2.3.3 to 2.5, and like the original poster my frontend of the site was working fine but I was getting the fatal error when trying to get in through wp-admin.

    Incidentally, i think I'm done with K2. It just isn't providing me with enough positives to justify the problems I keep having while trying to also keep my site up with the WP upgrades. :-/

  16. Tibor
    Member
    Posted 1 month ago #

    @dmchale I guess we should thank Tom Raftery (with my excuse for misspeling his name earlier).

  17. morethanwords
    Member
    Posted 1 month ago #

    I downloaded K2 RC4, copied the new files over the old RC3 ones, and it appears to have fixed the error for me.

    Same to me :)

  18. Narfmaster
    Member
    Posted 1 month ago #

    @Tibor: That worked great, thanks.

  19. duckster
    Member
    Posted 1 month ago #

    For me, it was the Now Reading plugin. I had to go to phpMyAdmin and find the activated plugins and delete the Now Reading plugin from there. After doing so, all is back to normal.

  20. BuffBillfan
    Member
    Posted 1 month ago #

    Hello Tibor,

    Thank you for posting the code above. I edited the file you specified and now I have my Admin panel again, but now when I go the URL in my browser, that code is sitting above the blog, at the top of the screen. How do I get that to go away and still keep the admin working?

    Oh, just in case you'd like to take a look, Here is the link.

    Thanks in advance for any help with this matter.

  21. Tibor
    Member
    Posted 1 month ago #

    @ BuffBillfan I don't see the problem you describe, using Firefox or Safari. In FF though, the yellow header background does not show up.

  22. davecahill
    Member
    Posted 2 weeks ago #

    From clicking on the link, it seems @BuffBillfan has fixed his problem.

    For anyone stumbling on this thread later though, his problem was due to the extra space character between the starting bracket and the question mark in the php snippets posted by @Tibor above.

    Remove that space and you get the following, which will work correctly:

    <?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();
    }
    }
    ?>

Reply

You must log in to post.

About this Topic