WP Native Dashboard
[resolved] Reason for 3.6 add_menu() error and quickfix (9 posts)

  1. Ov3rfly
    Posted 2 years ago #

    Many have see this error after updating to WordPress 3.6:

    Fatal error: Call to a member function add_menu() on a non-object in ../wp-content/plugins/wp-native-dashboard/langswitcher.php on line 28

    The problem is the drop-down menu in admin bar of backend. If the drop-down menu is enabled in WP Native Dashboard settings "extend Backend Admin Bar with a language quick selector", (options->enable_language_switcher), the error is triggered in WordPress 3.6 and no login is possible any more.

    Technical reason: The drop-down menu is added via an 'init' hook while it should be added via an 'admin_bar_menu' hook, see also here.

    As a complete fix is too complex for this forum, here a simple "quickfix" with one change which will remove / not add the drop down menu and avoid the error:

    The fix requires FTP access and is done in line 24 of file langswitcher.php:

    Current version:

    if(function_exists('is_admin_bar_showing') && is_admin_bar_showing() && $this->as_admin_bar) {


    if(is_object($wp_admin_bar) && function_exists('is_admin_bar_showing') && is_admin_bar_showing() && $this->as_admin_bar) {

    Note: To still be able to change language in WordPress 3.6 backend, use "extend Personal Profile Settings with users prefered language", (options->enable_profile_extension) setting of WP Native Dashboard for now...


  2. NickAndy
    Posted 2 years ago #

    Thanks Ov3rfly. Working once again! Greatly appreciated.

  3. mings
    Posted 2 years ago #

    Thank you very much Ov3rfly!

  4. Solko
    Posted 2 years ago #

    I love you xD

  5. codestyling
    Plugin Author

    Posted 2 years ago #

    The compatibility issue has been fixed at version 1.3.11

  6. iword2011
    Posted 2 years ago #

    I made the changes as mentioned above but now I get this error

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/user/public_html/mydomain.com/wp-content/plugins/extended-categories-widget/libs/avh-db.php on line 62 and defined in /home/user/public_html/mydomain.com/wp-includes/wp-db.php on line 992
    Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/mydomain.com/wp-includes/wp-db.php:992) in /home/user/public_html/mydomain.com/wp-includes/pluggable.php on line 875

    Can any body help I can't enter my wordpress site

  7. Ov3rfly
    Posted 2 years ago #

    @iword2011: The reason for your error is another plugin "AVH Extended Categories Widgets" and is obviously caused by changes from WordPress 3.4.x -> 3.5

    A fix for this plugin is e.g. here:

  8. NickAndy
    Posted 2 years ago #

    Thanks codestyling. All working well!

  9. paulmuaddib
    Posted 2 years ago #

    This post is a life saver! :)
    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Native Dashboard
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic