-
Home
-
Rent Fetch
- Tips
How to Hide Rent Fetch Admin Menus
function plt_hide_rentfetch_menus() {
//Hide "Properties".
remove_menu_page('edit.php?post_type=properties');
//Hide "Properties → Properties".
remove_submenu_page('edit.php?post_type=properties', 'edit.php?post_type=properties');
//Hide "Properties → Add new Property".
remove_submenu_page('edit.php?post_type=properties', 'post-new.php?post_type=properties');
//Hide "Properties → Property types".
remove_submenu_page('edit.php?post_type=properties', 'edit-tags.php?taxonomy=propertytypes&post_type=properties');
//Hide "Properties → Property categories".
remove_submenu_page('edit.php?post_type=properties', 'edit-tags.php?taxonomy=propertycategories&post_type=properties');
//Hide "Properties → Amenities".
remove_submenu_page('edit.php?post_type=properties', 'edit-tags.php?taxonomy=amenities&post_type=properties');
//Hide "Floorplans".
remove_menu_page('edit.php?post_type=floorplans');
//Hide "Floorplans → Floorplans".
remove_submenu_page('edit.php?post_type=floorplans', 'edit.php?post_type=floorplans');
//Hide "Floorplans → Add new Floorplan".
remove_submenu_page('edit.php?post_type=floorplans', 'post-new.php?post_type=floorplans');
//Hide "Floorplans → Floorplan categories".
remove_submenu_page('edit.php?post_type=floorplans', 'edit-tags.php?taxonomy=floorplancategory&post_type=floorplans');
//Hide "Floorplans → Floorplan types".
remove_submenu_page('edit.php?post_type=floorplans', 'edit-tags.php?taxonomy=floorplantype&post_type=floorplans');
//Hide "Units".
remove_menu_page('edit.php?post_type=units');
//Hide "Units → Units".
remove_submenu_page('edit.php?post_type=units', 'edit.php?post_type=units');
//Hide "Units → Add new Unit".
remove_submenu_page('edit.php?post_type=units', 'post-new.php?post_type=units');
//Hide "Rent Fetch".
remove_menu_page('rentfetch-options');
//Hide "Rent Fetch → Settings".
remove_submenu_page('rentfetch-options', 'rentfetch-options');
//Hide "Rent Fetch → Shortcodes".
remove_submenu_page('rentfetch-options', 'rentfetch-shortcodes');
//Hide "Rent Fetch → Documentation".
remove_submenu_page('rentfetch-options', 'rentfetch-documentation');
}
add_action('admin_menu', 'plt_hide_rentfetch_menus', 11);
Where do I put this code?
How to Hide Rent Fetch Meta Boxes
function plt_hide_rentfetch_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Property Identifiers" meta box.
remove_meta_box('rentfetch_properties_identifiers', $screen->id, 'normal');
//Hide the "Property Contact Information" meta box.
remove_meta_box('rentfetch_properties_contact', $screen->id, 'normal');
//Hide the "Property Location" meta box.
remove_meta_box('rentfetch_properties_location', $screen->id, 'normal');
//Hide the "Property Display Information" meta box.
remove_meta_box('rentfetch_properties_details', $screen->id, 'normal');
//Hide the "Floorplan Identifiers" meta box.
remove_meta_box('rentfetch_floorplans_identifiers', $screen->id, 'normal');
//Hide the "Floorplan Display Information" meta box.
remove_meta_box('rentfetch_floorplans_display', $screen->id, 'normal');
//Hide the "Floorplan Information" meta box.
remove_meta_box('rentfetch_floorplans_info', $screen->id, 'normal');
//Hide the "Floorplan Availability" meta box.
remove_meta_box('rentfetch_floorplans_availability', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_rentfetch_metaboxes', 20);