-
Home
-
CC Travel
- Tips
How to Hide CC Travel Admin Menus
function plt_hide_cc_travel_menus() {
//Hide "CC Travel".
remove_menu_page('cc-travel');
//Hide "Tour".
remove_menu_page('edit.php?post_type=cc_tour');
//Hide "Tour → Tour".
remove_submenu_page('edit.php?post_type=cc_tour', 'edit.php?post_type=cc_tour');
//Hide "Tour → Add Tour".
remove_submenu_page('edit.php?post_type=cc_tour', 'post-new.php?post_type=cc_tour');
//Hide "Tour → Destination".
remove_submenu_page('edit.php?post_type=cc_tour', 'edit-tags.php?taxonomy=cc_destination&post_type=cc_tour');
//Hide "Tour → Travel Style".
remove_submenu_page('edit.php?post_type=cc_tour', 'edit-tags.php?taxonomy=cc_travel_style&post_type=cc_tour');
//Hide "Booking".
remove_menu_page('edit.php?post_type=cc_booking');
//Hide "Booking → Booking".
remove_submenu_page('edit.php?post_type=cc_booking', 'edit.php?post_type=cc_booking');
//Hide "Booking → Add Booking".
remove_submenu_page('edit.php?post_type=cc_booking', 'post-new.php?post_type=cc_booking');
}
add_action('admin_menu', 'plt_hide_cc_travel_menus', 31);
Where do I put this code?
How to Hide CC Travel Meta Boxes
function plt_hide_cc_travel_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Tour Details" meta box.
remove_meta_box('_tour_details', $screen->id, 'normal');
//Hide the "Tour Itinerary" meta box.
remove_meta_box('_tour_itinerary', $screen->id, 'normal');
//Hide the "Departure Date" meta box.
remove_meta_box('_tour_departure_date', $screen->id, 'normal');
//Hide the "Media" meta box.
remove_meta_box('_tour_media', $screen->id, 'side');
//Hide the "Booking Info" meta box.
remove_meta_box('_booking_info', $screen->id, 'normal');
//Hide the "Admin Message" meta box.
remove_meta_box('_booking_admin_mes', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_cc_travel_metaboxes', 20);