Hi,
how can I allow editors to edit menus and prevent their access to theme options via GP Premium Plugin?
This is my functions.php:
if (current_user_can(‘editor’)) {
$role_object = get_role( ‘editor’ );
$role_object->add_cap( ‘edit_theme_options’ );
function hide_menu() {
remove_submenu_page( ‘themes.php’, ‘themes.php’ );
remove_submenu_page( ‘themes.php’, ‘widgets.php’ );
remove_submenu_page( ‘themes.php’, ‘themes.php?page=generate-options’ );
global $submenu;
unset($submenu[‘themes.php’][6]);
}
add_action(‘admin_head’, ‘hide_menu’);
}
The editor role still sees “Design > GeneratePress” and this way has access to theme options, which I don’t want.
Plugin Adminimize or User Role Editor doesn’t help either.
thanks for helping