The error line comes from the following in wp-admin/includes/plugin.php
:
function remove_menu_page( $menu_slug ) {
global $menu;
foreach ( $menu as $i => $item ) {
if ( $menu_slug === $item[2] ) {
unset( $menu[ $i ] );
return $item;
}
}
return false;
}
The global $menu
does not actually get populated until the wp-admin/menu-header.php
is included. See admin.php
-> admin-header.php
as well. Any hook prior to that include is going to throw a similar error.
The admin_init
hook is too early to access the global $menu
. You should be using the admin_menu
hook instead.
Related Posts:
- Please Help Me, How to Fix PHP Error Undefined Array Key “srcset”
- WP_DEBUG is not set, but I’m still getting warnings
- Object of class WP_Error could not be converted to string
- Getting Warnings & Notices from Fresh WordPress 3.1.2 install
- Removing warnings and notices from production servers
- Handle new created WP_Error
- How do iterate through all errors for a WP_Error object?
- Getting notices on fresh 3.6.1 install
- Website Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘Wppr_Public’ does not have a method ‘amp_support’
- Warning: spl_autoload() [function.spl-autoload] (Term Menu Order)
- Warning: call_user_func_array() [function.call-user-func-array]
- warnings & errors after MAMP to live (hosteurope)
- Lots of warnings and errors instead of my WordPress site – Synology NAS – Intranet
- How do I turn off WordPress errors and just have regular old php errors?
- Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error
- Change login error messages
- Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445
- Notice: Constant WP_POST_REVISIONS already defined
- How to stop certain warning logging in error.log?
- Debug mode shows Strict Standards
- Why on Earth am I getting “undefined_index” errors?
- Displaying oEmbed errors?
- “Apache HTTP Service has stopped working” with WP Query in WordPress 2.9.2
- Add image only in first post
- Showing “ Notice: Undefined variable:” and “ Notice: Trying to get property of non-object”
- Publishing Time – WordPress Plain White Screen with No Error
- What is causing this error? “Warning: Invalid argument”
- add_sub_menu page() to be replaced by add_theme_page()
- How to customize the critical error message?
- What does this error mean? WordPress database error: [MySQL server has gone away]
- Fatal error: Call to undefined function is_multisite()
- Error trying to publish immediately. Post status = future (Missed schedule error)
- Form Post results in 404 Not Found [duplicate]
- WordPress white screen with word ‘error’ [closed]
- File does not exist – wp-index.php
- I need https::/mysite.com instead of https::/mysite.com/wordpress
- Nginx 404, 500 errors and WordPress
- Warning: Invalid argument supplied for foreach() in portfolio-list.php [closed]
- “Undefined index” in wp-includes/media.php
- Can’t post to my WordPress site
- Error message prevents access to WP
- I could not access my website wp-admin after installing SSL. And error with mixed content
- Page Not Found on categories / tags / pages
- is there any function to store logs & send mail to admin?
- Error: Warning: strpos() in media.php
- Error on moving WordPress site to Host from Local installation
- wp_remote_get sslv3 alert handshake failure
- Error after moving WordPress installation
- Declare Global Variable In OOP PHP
- How can I fix buggy WordPress dashboard [duplicate]
- I was adding the custom CSS & JS using hooks and there was this error even I didn’t touch the wp-class-hook
- Why can I not execute php files under the wp-includes folder?
- Enqueued stylesheet appends query string, causing “SyntaxError: Invalid or unexpected token”
- WordPress custom plugin gives error
- Can’t access my site please help
- WP displays “some_strange_number Version” in the bottom right corner
- Weird string offset errors when displaying post attachments
- @file_get_contents and wp_remote_get
- Headers already sent by
- Failed: Filesystem preventing downloads. ( ftpext)
- Code snippet to display ID gives critical error
- I tried to build a theme from scratch and it crashed everything
- Unable to locate WordPress content directory
- Cannot upgrade to 4.0 – get SSL certificate error
- download count29.php whene loading site [closed]
- Of thumbnails and folder permissions
- Media dint apper in wordpress media library after uploaded through file manager
- When trying to access home page, WordPress appends /wordpress to domain name which gives 404 error
- How to turn off WP error handling, but turn on php error handling?
- Fatal error: Uncaught Error: Maximum function nesting level of ‘5000’ reached
- Suddenly get errors in admin when editing post type
- Cannot update WordPress Core via admin dashboard
- When writing a new blog post error message ‘ sorry, you are not allowed to edit this page ‘
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘add_custom_scripts’ not found or invalid function name
- Header already sent, error shows core files
- : this page isn’t working. is unable to handle the request. Http error 500
- admin page error
- How do I create a state of “don’t assign anything to variable” if WP_Error throws an error?
- Theme unit test error
- Installation problem with wordpress xampp
- WordPress fails when my post is larger than 1400 words
- Undefined index action Cannot modify header
- Unnessary character on post after restore
- wp_list _table You do not have sufficient permissions to access this page error
- Dashboard doesn’t work propertly
- Weird Parse Error on Uploaded File
- Error establishing a database connection in godaddy.com
- WordPress doesn’t recognise my email address and I’m missing the wp-config file in PHPmyadmin cPanel to make alterations
- Parse error: syntax error, unexpected ‘$q74ed’ (T_VARIABLE)
- Fatal error: Call to a member function update() on a non-object in my resturant plugin file restaurants.php
- Fatal error: require(): Failed opening required ‘load.php’
- Can (slow) Internet speed get you a 500 server error? [closed]
- Better error messages upon critical errors – HTTP Error 500
- WordPress Customizer not loading
- Is it possible to empty debug.log programmatically?
- File doesn’t exist! in wordpress function.php file while creating new post or page
- Change Registration Error Message
- syntax error, unexpected ‘=>’ (T_DOUBLE_ARROW) [closed]
- My websit dosent worke http errors 500
- 403 forbidden in admin console: fix seems to be temporary and then error is back