Skip to main content
All CollectionsCustomization
How to Hide MapGeo for editors in the WordPress backend
How to Hide MapGeo for editors in the WordPress backend
James avatar
Written by James
Updated over a month ago

This can be turned off with this code in the functions.php:


function hide_map_geo_for_editors()
{
if (current_user_can('editor')) {
remove_menu_page('edit.php?post_type=igmap');
}
}
add_action('admin_menu', 'hide_map_geo_for_editors', 999);


function hide_map_geo_in_admin_bar($wp_admin_bar)
{
if (current_user_can('editor')) {
$wp_admin_bar->remove_node('new-igmap'); // 'new-igmap' ist der ID-Wert für den "Map"-Menüpunkt im "Neu"-Menü
}
}
add_action('admin_bar_menu', 'hide_map_geo_in_admin_bar', 999);
Did this answer your question?