I'm trying to remove access to everything in the appearance menu in WP admin for the role editor. Or at the least, just remove access to themes and plugins. I have found how to remove the whole appearance menu but not parts of it like that. is this possible?
Preferably something in functions.php so I could toggle this on/off if ever I needed.
I'm trying to remove access to everything in the appearance menu in WP admin for the role editor. Or at the least, just remove access to themes and plugins. I have found how to remove the whole appearance menu but not parts of it like that. is this possible?
Preferably something in functions.php so I could toggle this on/off if ever I needed.
Share Improve this question asked Nov 28, 2018 at 20:54 M21M21 1113 bronze badges1 Answer
Reset to default 1by default the editor
role should not have access to plugins nor appearance menu. But maybe this roles is already customised in your installation? here is a list of editor default capabilities
via functions.php you can remove everything in the appearance menu like so:
$role_object = get_role( 'editor' );
$role_object->remove_cap( 'edit_theme_options' );
to remove access to plugins you would have to remove some more capabilities i assume. update_plugins
, delete_plugins
and so on...
otherwise you could use a plugin to handle different roles comfortable. i do use adminimize quite a while.