You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With 2.0.0.-alpha: In my functions.php, I check if a user is an admin, and if not, then I hide all Admin Panel items using remove_menu_page. However, when AMM is activated, certain items reappear: Home, All Posts, All Comments, Available Tools. This is consistent and repeatable. When AMM plugin is deactivated, the items are again hidden. Here is my code, pop it into your functions.php and you'll see what I mean. With that code in your functions.php:
deactivate AMM plugin and login as a non-admin user, navigate to wp-admin and notice the panel is empty.
activate AMM plugin and refresh, notice the admin panel is no longer empty.
Right now the plugin hooks into admin_menu as well and basically tries to build a new menu from scratch. Since the complete menu is stored in an option, the removed pages are still in there and need to be removed somehow.
I suspect that Parent_Menu_Iterator::is_top_level_item() correctly returns false because the menu pages do not exist anymore. However, Parent_Menu_Iterator::is_submenu_item() might return true in that case because every parent menu item has a child with the same name.
Parent_Menu_Iterator::is_submenu_item() exists because you're able to move a child menu item to the top level and this needs to be detected somehow. Perhaps this detection needs to be done better so that we can distinguish between moved and deleted menu items.
With 2.0.0.-alpha: In my functions.php, I check if a user is an admin, and if not, then I hide all Admin Panel items using remove_menu_page. However, when AMM is activated, certain items reappear: Home, All Posts, All Comments, Available Tools. This is consistent and repeatable. When AMM plugin is deactivated, the items are again hidden. Here is my code, pop it into your functions.php and you'll see what I mean. With that code in your functions.php:
The text was updated successfully, but these errors were encountered: