WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. ponchito147
    Member
    Posted 6 years 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 6 years 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 6 years 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 6 years 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 6 years 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 6 years 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?

    http://www.theroxyonsunset.com

  7. nick58b
    Member
    Posted 6 years 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 6 years ago #

    Never mind, works now.

  9. ponchito147
    Member
    Posted 6 years 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 6 years 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 6 years ago #

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

    ah... upgrading, how I love it.

  12. Tibor Paulsch
    Member
    Posted 6 years 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 6 years 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 Paulsch
    Member
    Posted 6 years 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: http://www.yourdomain.com/wp-admin/plugins.php).

  15. dmchale
    Member
    Posted 6 years 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 Paulsch
    Member
    Posted 6 years ago #

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

  17. morethanwords
    Member
    Posted 6 years 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 6 years ago #

    @Tibor: That worked great, thanks.

  19. duckster
    Member
    Posted 6 years 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 6 years 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 Paulsch
    Member
    Posted 6 years 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 5 years 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();
    }
    }
    ?>

  23. shacker
    Member
    Posted 5 years ago #

    For one of my user's sites, this problem cropped with the Sidebar Module plugin. Fortunately they didn't need it / weren't using it and we were able to safely disable it.

  24. journeyguy
    Member
    Posted 5 years ago #

    My problem was the Sidebar Module Reloaded plugin. deactivating it fixed the issue.

  25. matuvu
    Member
    Posted 5 years ago #

    i have the same problem: i cannot see my dashboard
    the message:

    Fatal error: Call to undefined function: wp_register_sidebar_widget() in /nfs/c01/h02/mnt/4820/domains/soundscapes.be/html/blog/wp-admin/includes/dashboard.php on line 32

    I am not using K2, but TripleK2 and don't have the files you're talking about. I do have app/includes/sbm.php
    i tried to replace this with the recent k2, but that didn't work out well.
    anyone an idea what I can do to fix the dashboard?
    I don't feel like making a new theme (it's an modified theme which looks great in my opinion).

    The code of the sbm.php

    <?php

    function sbm_get_option($name) {
    global $k2sbm_current_module;

    return $k2sbm_current_module->get_option($name);
    }

    function sbm_add_option($name, $value = '', $description = '', $autoload = 'yes') {
    global $k2sbm_current_module;

    $k2sbm_current_module->add_option($name, $value, $description);
    }

    function sbm_update_option($name, $newvalue) {
    global $k2sbm_current_module;

    $k2sbm_current_module->update_option($name, $newvalue);
    }

    function sbm_delete_option($name) {
    global $k2sbm_current_module;

    $k2sbm_current_module->delete_option($name);
    }

    function register_sidebar($args = array()) {
    K2SBM::register_sidebar($args);
    }

    function unregister_sidebar($name) {
    K2SBM::unregister_sidebar($name);
    }

    function register_sidebars($count = 1, $args = array()) {
    K2SBM::register_sidebars($count, $args);
    }

    function dynamic_sidebar($name = 1) {
    return K2SBM::dynamic_sidebar($name);
    }

    function register_sidebar_module($name, $callback, $css_class = '', $options = array()) {
    K2SBM::register_sidebar_module($name, $callback, $css_class, $options);
    }

    function unregister_sidebar_module($name) {
    K2SBM::unregister_sidebar_module($name);
    }

    function is_active_module($callback) {
    return K2SBM::is_active_module($callback);
    }

    function register_sidebar_module_control($name, $callback) {
    K2SBM::register_sidebar_module_control($name, $callback);
    }

    function unregister_sidebar_module_control($name) {
    K2SBM::unregister_sidebar_module_control($name);
    }

    function register_sidebar_widget($name, $callback, $classname = '') {
    K2SBM::register_sidebar_module($name, $callback, $classname);
    }

    function unregister_sidebar_widget($name) {
    K2SBM::unregister_sidebar_module($name);
    }

    function is_active_widget($callback) {
    return K2SBM::is_active_module($callback);
    }

    function register_widget_control($name, $callback, $width = false, $height = false) {
    // Chop off W & H, not needed
    K2SBM::register_sidebar_module_control($name, $callback);
    }

    function unregister_widget_control($name) {
    K2SBM::unregister_sidebar_module_control($name);
    }

    ?>

    tx for trying to help.

  26. sjogro
    Member
    Posted 5 years ago #

    Thanks a lot @Tibor and @davecahill, together you solved my problem using the Plainbox theme (based on K2) in the posts above. To me this is what did it:

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

    (That was Tibor's advice, with davecahill's correction).

  27. journeyguy
    Member
    Posted 5 years ago #

    Any help with the sidebar module reloaded issue? It disables the WP Dashboard.

  28. nrosquist
    Member
    Posted 5 years ago #

    Thanks @sjogro, this is soooo helpful.

  29. nelsoc
    Member
    Posted 5 years ago #

    I'm not using K2. I just upgraded from 2.3.1 to 2.6 and I'm getting this error on register_sidebar() and when I comment that out, it changes to wp_register_sidebar_widget().

    I can access the other pages of the admin if I navigate to them manually. It seems that everything else works except for the dashboard. I guess since there's a workaround, it's not that big a deal, but I'd like to have it fully functioning.

    I deactivated all plugins before upgrading, and the plugin manager still shows them all as not active.

    Any ideas?

  30. beisbolct
    Member
    Posted 5 years ago #

    I don't even use K2 at all, I use cutline yet I just had these ridiculous query times that caused the cpu to exceed.

    # Sat Aug 30 21:24:50 2008
    # Query_time: 121 Lock_time: 78 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:52 2008
    # Query_time: 119 Lock_time: 74 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:52 2008
    # Query_time: 127 Lock_time: 81 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:52 2008
    # Query_time: 117 Lock_time: 72 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:52 2008
    # Query_time: 122 Lock_time: 77 Rows_sent: 1 Rows_examined: 1
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:52 2008
    # Query_time: 115 Lock_time: 70 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:52 2008
    # Query_time: 120 Lock_time: 75 Rows_sent: 1 Rows_examined: 0
    use ianbethu_wrdp1;
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID = 3836 AND wp_posts.post_type = 'post' ORDER BY wp_posts.post_date DESC

    # Sat Aug 30 21:24:53 2008
    # Query_time: 115 Lock_time: 72 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:53 2008
    # Query_time: 113 Lock_time: 71 Rows_sent: 1 Rows_examined: 1
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:53 2008
    # Query_time: 112 Lock_time: 70 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:53 2008
    # Query_time: 107 Lock_time: 65 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:53 2008
    # Query_time: 108 Lock_time: 66 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:53 2008
    # Query_time: 103 Lock_time: 61 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:53 2008
    # Query_time: 116 Lock_time: 70 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:57 2008
    # Query_time: 102 Lock_time: 91 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 97 Lock_time: 87 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 97 Lock_time: 87 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 90 Lock_time: 81 Rows_sent: 1 Rows_examined: 1
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 84 Lock_time: 75 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 82 Lock_time: 73 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 81 Lock_time: 72 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 67 Lock_time: 59 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 72 Lock_time: 64 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2installed' LIMIT 1

    # Sat Aug 30 21:24:58 2008
    # Query_time: 41 Lock_time: 36 Rows_sent: 1 Rows_examined: 1
    use ianbethu_wrdp1;
    SELECT option_value FROM wp_options WHERE option_name = 'k2deliciousname' LIMIT 1

Topic Closed

This topic has been closed to new replies.

About this Topic