<?php
// add editor the privilege to edit theme
// comment out after reloading site
// get the the role object
$role_object = get_role( 'editor' );
// add $cap capability to this role object
$role_object->add_cap( 'edit_theme_options' );
// comment out above after reloading site
function xxx_hide_menu() {
if (current_user_can('editor')) {
remove_submenu_page( 'themes.php', 'themes.php' ); // hide the theme selection submenu
remove_submenu_page( 'themes.php', 'widgets.php' ); // hide the widgets submenu
remove_submenu_page( 'themes.php', 'customize.php?return=%2Fwp-admin%2Ftools.php' ); // hide the customizer submenu
remove_submenu_page( 'themes.php', 'customize.php?return=%2Fwp-admin%2Ftools.php&autofocus%5Bcontrol%5D=background_image' ); // hide the background submenu
// these are theme-specific. Can have other names or simply not exist in your current theme.
remove_submenu_page( 'themes.php', 'yiw_panel' );
remove_submenu_page( 'themes.php', 'custom-header' );
remove_submenu_page( 'themes.php', 'custom-background' );
}
}
add_action('admin_head', 'xxx_hide_menu');
// source - https://wordpress.stackexchange.com/questions/4191/allow-editors-to-edit-menus