Replies: 0
Hey,
While tracking the source of warnings constantly filling debug log found out it was due to the following line in this plugin:
remove-admin-menus-by-role.php:169:
foreach($menus_hidden as $menu)
remove_menu_page($menu);
If you check remove_menu_page() reference, it says:
This function should be called on the admin_menu action hook. Calling it elsewhere might cause issues: either the function is not defined or the global $menu variable used but this function is not yet declared.
The correct code should be:
foreach($menus_hidden as $menu)
add_action('admin_menu', remove_menu_page($menu));
Please consider.
Thanks