-
Home
-
Mapster WP Maps
- Tips
How to Hide Mapster WP Maps Admin Menus
function plt_hide_mapster_wp_maps_menus() {
//Hide "Maps".
remove_menu_page('edit.php?post_type=mapster-wp-map');
//Hide "Maps → Maps".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'edit.php?post_type=mapster-wp-map');
//Hide "Maps → Add New Map".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'post-new.php?post_type=mapster-wp-map');
//Hide "Maps → Map Categories".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'edit-tags.php?taxonomy=wp-map-category&post_type=mapster-wp-map');
//Hide "Maps → Locations".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'edit.php?post_type=mapster-wp-location');
//Hide "Maps → Lines".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'edit.php?post_type=mapster-wp-line');
//Hide "Maps → Polygons".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'edit.php?post_type=mapster-wp-polygon');
//Hide "Maps → Popup Templates".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'edit.php?post_type=mapster-wp-popup');
//Hide "Maps → Categories".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'edit-tags.php?taxonomy=wp-map-category&post_type=mapster-wp-map');
//Hide "Maps → Settings".
remove_submenu_page('edit.php?post_type=mapster-wp-map', 'wordpress-maps-settings');
}
add_action('admin_menu', 'plt_hide_mapster_wp_maps_menus', 1000000000);
Where do I put this code?
How to Hide the "Map Preview" Meta Box
function plt_hide_mapster_wp_maps_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Map Preview" meta box.
remove_meta_box('mapster-wp-maps-preview', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_mapster_wp_maps_metaboxes', 20);