WordPress.org

Ready to get started?Download WordPress

Forums

Call to undefined method Custom_Admin_Bar::add_group() (6 posts)

  1. oldwebgeek
    Member
    Posted 2 years ago #

    We're seeing this error appear in the Dashboard in most of our custom themes after upgrading to WordPress 3.3.

    Switching to the Twenty 11 theme seems to resolve the issue so this seems to be a backwards-compatibility issue.

    The error message is:

    Fatal error: Call to undefined method Custom_Admin_Bar::add_group() in /wp-includes/admin-bar.php on line 169

    As a result of this, the Dashboard toolbar doesn't work in either the Dashboard or the front-end.

  2. gosbdc
    Member
    Posted 2 years ago #

    Add groups is causing a fatal error. Any feedback on this?

    My quick fix was to edit admin-bar.php and strike all references to add_group(), but that has significantly broken the admin bar. At least it's there, and now not blocking other functions.

    WP, any feedback on this issue?

  3. Sergey Biryukov
    WordPress Dev
    Posted 2 years ago #

    This error means some plugin or your theme is replacing the standard Admin_Bar class with some Custom_Admin_Bar one which is missing the add_group() method.

    For example, this code snippet would cause exactly the same error:
    http://pastebin.com/H2PuzzE3

    In WordPress.org directory, I have not found any plugins or themes doing this.

    If disabling plugins didn't help, I'd suggest searching for wp_admin_bar_class string in your theme files.

  4. gosbdc
    Member
    Posted 2 years ago #

    @Sergey

    Thanks. Your info gave me the hint I needed to fix this issue. My custom theme, in the classes.php file had a version of the Custom_Admin_Bar. I commented it out and removed the comments blocking the add_group in the includes/admin-bar.php file.

    Problem solved. Thanks again for the hint! Saved my bacon!

  5. webfanatic
    Member
    Posted 2 years ago #

    Thanks! This did the trick for me, too. I commented out the Custom_Admin_Bar class in classes.php. I also noticed a deprecation warning for automatic_feed_links( false ) which I changed to add_theme_support( 'automatic-feed-links' ). Now error logs and UI are clean.

  6. K15
    Member
    Posted 2 years ago #

    Can you guys please explain in further detail on how to fix this? I'm a noob to editing wp themes!

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic