Anbody using "if ( current_user_can( 'editor' )) {"???
-
I found a bit of code that is supposed to hide various dashboard menu items from users, depending on their role.
I’ve tried adding this to my multisite, but it doesn’t seem to recognise the “editor” role?
function delete_menu_items(){ remove_menu_page('tools.php'); // Tools remove_menu_page('options-general.php'); // Settings} if ( current_user_can( 'editor' )) {add_action( 'admin_init', 'delete_menu_items' );}
If I swap editor for administrator then it removes the items from the admin menu and leaves them if you’re an editor.. just can’t seem to get it to work the other way round, which is what I need?
Thanks
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Anbody using "if ( current_user_can( 'editor' )) {"???’ is closed to new replies.