Title: Reason for 3.6 add_menu() error and quickfix
Last modified: August 21, 2016

---

# Reason for 3.6 add_menu() error and quickfix

 *  Resolved [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/)
 * 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](http://core.trac.wordpress.org/ticket/24927).
 * 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) {
       ```
   
 * Quickfix:
 *     ```
       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…
 * [http://wordpress.org/plugins/wp-native-dashboard/](http://wordpress.org/plugins/wp-native-dashboard/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [NickAndy](https://wordpress.org/support/users/nickandy/)
 * (@nickandy)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994198)
 * Thanks Ov3rfly. Working once again! Greatly appreciated.
 *  [mings](https://wordpress.org/support/users/mingma/)
 * (@mingma)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994280)
 * Thank you very much Ov3rfly!
 *  [Solko](https://wordpress.org/support/users/solko/)
 * (@solko)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994310)
 * I love you xD
 *  Plugin Author [codestyling](https://wordpress.org/support/users/codestyling/)
 * (@codestyling)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994315)
 * The compatibility issue has been fixed at version 1.3.11
 *  [iword2011](https://wordpress.org/support/users/iword2011/)
 * (@iword2011)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994339)
 * 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
 *  Thread Starter [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994341)
 * [@iword2011](https://wordpress.org/support/users/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:
    [http://wordpress.org/support/topic/missing-argument-2-for-wpdbprepare](http://wordpress.org/support/topic/missing-argument-2-for-wpdbprepare)
 *  [NickAndy](https://wordpress.org/support/users/nickandy/)
 * (@nickandy)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994346)
 * Thanks codestyling. All working well!
 *  [paulmuaddib](https://wordpress.org/support/users/paulmuaddib/)
 * (@paulmuaddib)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994394)
 * This post is a life saver! 🙂
    **Thank you!**

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Reason for 3.6 add_menu() error and quickfix’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-native-dashboard_d8d8d8.svg)
 * [WP Native Dashboard](https://wordpress.org/plugins/wp-native-dashboard/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-native-dashboard/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-native-dashboard/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-native-dashboard/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-native-dashboard/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-native-dashboard/reviews/)

## Tags

 * [init](https://wordpress.org/support/topic-tag/init/)
 * [non object](https://wordpress.org/support/topic-tag/non-object/)

 * 8 replies
 * 7 participants
 * Last reply from: [paulmuaddib](https://wordpress.org/support/users/paulmuaddib/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/reason-for-36-errors-and-quickfix/#post-3994394)
 * Status: resolved