-
Home
-
Custom WP Store Locator
- Tips
How to Hide Custom WP Store Locator Admin Menus
function plt_hide_custom_store_locator_menus() {
//Hide "Locations".
remove_menu_page('edit.php?post_type=csl_locations');
//Hide "Locations → Locations".
remove_submenu_page('edit.php?post_type=csl_locations', 'edit.php?post_type=csl_locations');
//Hide "Locations → Add New Post".
remove_submenu_page('edit.php?post_type=csl_locations', 'post-new.php?post_type=csl_locations');
//Hide "Locations → Location Categories".
remove_submenu_page('edit.php?post_type=csl_locations', 'edit-tags.php?taxonomy=csl_locations_categories&post_type=csl_locations');
//Hide "Store Locator".
remove_menu_page('store_plugin');
//Hide "Store Locator → About".
remove_submenu_page('store_plugin', 'store_plugin');
//Hide "Store Locator → Settings".
remove_submenu_page('store_plugin', 'store_plugin_settings');
}
add_action('admin_menu', 'plt_hide_custom_store_locator_menus', 11);
Where do I put this code?
How to Hide the "Store Locator Settings" Meta Box
function plt_hide_custom_store_locator_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Store Locator Settings" meta box.
remove_meta_box('csl_metabox_settings', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_custom_store_locator_metaboxes', 20);