remove_menu_page not working on some menu items
-
I have a custom plugin that I’m using to hide admin menu pages from Administrators so that they can only be seen by Super Admins. It was working until I upgraded to 3.8.1, and now some admin menu pages that are supposed to be hidden are showing.
Here’s the function:
function s_remove_menu_pages() { if (!current_user_can('manage_network')){ remove_menu_page('index.php'); remove_menu_page('users.php'); remove_menu_page('tools.php'); remove_menu_page('options-general.php'); } } add_action('admin_init', 's_remove_menu_pages', 999);
All of these pages except users.php are showing in the menu for Administrators.
I’ve tried using admin_menu instead of admin_init. I’ve tried changing the number from 999 to a different (smaller) number.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘remove_menu_page not working on some menu items’ is closed to new replies.