zartgesotten
11/21/2017 - 2:21 PM

Allow Editor to edit Menus

Allows users with the role editor (Redakteur) to edit menus in Design > Menus. Hides all other submenus including Generate Press

<?php 
// Allow editors to see Appearance menu
$role_object = get_role( 'editor' );
$role_object->add_cap( 'edit_theme_options' );
function hide_menu() {
     // Hide theme selection page
    remove_submenu_page( 'themes.php', 'themes.php' ); 
    // Hide widgets page
    remove_submenu_page( 'themes.php', 'widgets.php' );
 
    // Hide customize page
    global $submenu;
    unset($submenu['themes.php'][6]);
	
	remove_submenu_page( 'themes.php', 'generate-options' );
	

    }
    ?>