-
Home
-
Custom Map for Real Estate
- Tips
How to Hide Custom Map for Real Estate Admin Menus
function plt_hide_custom_map_for_real_estate_menus() {
//Hide the "Map For RE" menu.
remove_menu_page('edit.php?post_type=all_map');
//Hide the "Map For RE → All Items" menu.
remove_submenu_page('edit.php?post_type=all_map', 'edit.php?post_type=all_map');
//Hide the "Map For RE → Add New Item" menu.
remove_submenu_page('edit.php?post_type=all_map', 'post-new.php?post_type=all_map');
}
add_action('admin_menu', 'plt_hide_custom_map_for_real_estate_menus', 15);
Where do I put this code?
How to Hide Custom Map for Real Estate Meta Boxes
function plt_hide_custom_map_for_real_estate_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Map Data" meta box.
remove_meta_box('map4re-metabox', $screen->id, 'normal');
//Hide the "Shortcode" meta box.
remove_meta_box('map4re-shortcode', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_custom_map_for_real_estate_metaboxes', 20);