-
Home
-
WP Hotelier
- Tips
How to Hide WP Hotelier Admin Menus
function plt_hide_wp_hotelier_menus() {
//Hide "Hotelier".
remove_menu_page('hotelier-settings');
//Hide "Hotelier → Settings".
remove_submenu_page('hotelier-settings', 'hotelier-settings');
//Hide "Hotelier → Add Reservation".
remove_submenu_page('hotelier-settings', 'hotelier-add-reservation');
//Hide "Hotelier → Reservations".
remove_submenu_page('hotelier-settings', 'edit.php?post_type=room_reservation');
//Hide "Hotelier → Extras".
remove_submenu_page('hotelier-settings', 'edit.php?post_type=extra');
//Hide "Hotelier → Calendar".
remove_submenu_page('hotelier-settings', 'hotelier-calendar');
//Hide "Hotelier → Logs".
remove_submenu_page('hotelier-settings', 'hotelier-logs');
//Hide "Rooms".
remove_menu_page('edit.php?post_type=room');
//Hide "Rooms → All Rooms".
remove_submenu_page('edit.php?post_type=room', 'edit.php?post_type=room');
//Hide "Rooms → Add New Room".
remove_submenu_page('edit.php?post_type=room', 'post-new.php?post_type=room');
//Hide "Rooms → Categories".
remove_submenu_page('edit.php?post_type=room', 'edit-tags.php?taxonomy=room_cat&post_type=room');
//Hide "Rooms → Rates".
remove_submenu_page('edit.php?post_type=room', 'edit-tags.php?taxonomy=room_rate&post_type=room');
//Hide "Rooms → Facilities".
remove_submenu_page('edit.php?post_type=room', 'edit-tags.php?taxonomy=room_facilities&post_type=room');
}
add_action('admin_menu', 'plt_hide_wp_hotelier_menus', 51);
Where do I put this code?
How to Hide WP Hotelier Meta Boxes
function plt_hide_wp_hotelier_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Room Gallery" meta box.
remove_meta_box('hotelier-room-images', $screen->id, 'side');
//Hide the "Room Settings" meta box.
remove_meta_box('hotelier-room-settings', $screen->id, 'normal');
//Hide the "Room Short Description" meta box.
remove_meta_box('postexcerpt', $screen->id, 'normal');
//Hide the "Save Reservation" meta box.
remove_meta_box('hotelier-reservation-save', $screen->id, 'side');
//Hide the "Reservation Notes" meta box.
remove_meta_box('hotelier-reservation-notes', $screen->id, 'side');
//Hide the "Reservation Details" meta box.
remove_meta_box('hotelier-reservation-data', $screen->id, 'normal');
//Hide the "Rooms" meta box.
remove_meta_box('hotelier-reservation-items', $screen->id, 'normal');
//Hide the "Coupon Settings" meta box.
remove_meta_box('hotelier-coupon-settings', $screen->id, 'normal');
//Hide the "Extra Settings" meta box.
remove_meta_box('hotelier-extra-settings', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_wp_hotelier_metaboxes', 20);