-
Home
-
Smjrifle Interactive Maps with Google Maps and Leaflet
- Tips
How to Hide Smjrifle Interactive Maps with Google Maps and Leaflet Admin Menus
function plt_hide_smjrifle_interactive_maps_menus() {
//Hide "Smjrifle Interactive Maps".
remove_menu_page('edit.php?post_type=smjrgoma_map');
//Hide "Smjrifle Interactive Maps → Smjrifle Interactive Maps".
remove_submenu_page('edit.php?post_type=smjrgoma_map', 'edit.php?post_type=smjrgoma_map');
//Hide "Smjrifle Interactive Maps → Add New Map".
remove_submenu_page('edit.php?post_type=smjrgoma_map', 'post-new.php?post_type=smjrgoma_map');
//Hide "Smjrifle Interactive Maps → Settings".
remove_submenu_page('edit.php?post_type=smjrgoma_map', 'smjrgoma-settings');
}
add_action('admin_menu', 'plt_hide_smjrifle_interactive_maps_menus', 11);
Where do I put this code?
How to Hide Smjrifle Interactive Maps with Google Maps and Leaflet Meta Boxes
function plt_hide_smjrifle_interactive_maps_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Map Settings" meta box.
remove_meta_box('smjrgoma_map_settings', $screen->id, 'normal');
//Hide the "Shortcode" meta box.
remove_meta_box('smjrgoma_map_shortcode', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_smjrifle_interactive_maps_metaboxes', 20);