Hide submenus based on role
-
I know there have been many discussion on hiding submenus based on role, but I cannot seem to get it to work in a way that hides submenus for the editor role in my multisite but not for other roles.
I am trying to hide:
Appearance > Themes
Appearance > Customize
Appearance > Header
Appearance > BackgroundI only want editors to have access to Widgets and Menus. I thought the below would work but it hasn’t:
$role = get_role( 'editor' ); } function my_remove_menu_pages() { if(!current_user_can('editor')) { remove_submenu_page ('themes.php', 'themes.php'); remove_submenu_page ('themes.php', 'custom-header'); remove_submenu_page( 'themes.php', 'custom-background'); } } add_action( 'admin_init', 'my_remove_menu_pages' );
I appreciate any help.
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Hide submenus based on role’ is closed to new replies.