#19937 closed defect (bug) (invalid)
'remove_menu_page' causes a Warning when 'Edit Image'
Reported by: | carlos_a_sanz | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3.1 |
Component: | Media | Keywords: | close |
Focuses: | Cc: |
Description
Calling remove_menu_page function on a admin_init hook causes this warning:
Warning: Invalid argument supplied for foreach() in /users/knut/workspace/adlerfresneda.com/htdocs/dev/wp-admin/includes/plugin.php on line 1261
This occurs when [Edit Image] has tightened on Media section and MediaUpload popup, therfore, the image for editing does not load.
Change History (5)
Note: See
TracTickets for help on using
tickets.
Admin menu functions such as add_menu_page(), add_submenu_page(), remove_menu_page(), and remove_submenu_page(), need to happen on the
admin_menu
hook, not theadmin_init
hook.The admin_init hook fires in some situations where there is no UI for which a menu will be built -- for example, the media popup, or admin-ajax.