// sta editors toe om menu en widgets te bewerken en verberg vervolgens de themes, tools en customize paginas
function wbmz_editor_xtra_options() {
$role_object = get_role( 'editor' );
$role_object->add_cap( 'edit_theme_options' );
if (current_user_can('editor')) {
remove_submenu_page( 'themes.php', 'themes.php' );
remove_menu_page( 'tools.php' );
global $submenu;
if ( isset( $submenu[ 'themes.php' ] ) ) {
foreach ( $submenu[ 'themes.php' ] as $index => $menu_item ) {
if(in_array('Customize', $menu_item) || in_array('Customizer', $menu_item) || in_array('customize', $menu_item))
{
unset( $submenu[ 'themes.php' ][ $index ] );
}
}
}
}
}
add_action('admin_head', 'wbmz_editor_xtra_options');
#admin #customize #editors #functions #menu #redacteuren #tools #widgets