-
Home
-
WP Real Estate
- Tips
How to Hide WP Real Estate Admin Menus
function plt_hide_wp_real_estate_menus() {
//Hide "Listings".
remove_menu_page('edit.php?post_type=listing');
//Hide "Listings → Listings".
remove_submenu_page('edit.php?post_type=listing', 'edit.php?post_type=listing');
//Hide "Listings → New Listing".
remove_submenu_page('edit.php?post_type=listing', 'post-new.php?post_type=listing');
//Hide "Listings → Listing Type".
remove_submenu_page('edit.php?post_type=listing', 'edit-tags.php?taxonomy=listing-type&post_type=listing');
//Hide "Listings → Agents".
remove_submenu_page('edit.php?post_type=listing', 'users.php?role=wre_agent');
//Hide "Listings → Enquiries".
remove_submenu_page('edit.php?post_type=listing', 'edit.php?post_type=listing-enquiry');
//Hide "Listings → Import IDX Listings".
remove_submenu_page('edit.php?post_type=listing', 'wre-idx-listing');
//Hide "Listings → WRE Settings".
remove_submenu_page('edit.php?post_type=listing', 'wre_options');
}
add_action('admin_menu', 'plt_hide_wp_real_estate_menus', 13);
Where do I put this code?
How to Hide WP Real Estate Meta Boxes
function plt_hide_wp_real_estate_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Listing Description" meta box.
remove_meta_box('_wre_listing_description', $screen->id, 'normal');
//Hide the "Listing Details" meta box.
remove_meta_box('_wre_listing_details', $screen->id, 'normal');
//Hide the "Listing Features" meta box.
remove_meta_box('_wre_listing_features', $screen->id, 'normal');
//Hide the "Images" meta box.
remove_meta_box('_wre_listing_images', $screen->id, 'normal');
//Hide the "Listing Status" meta box.
remove_meta_box('_wre_listing_status', $screen->id, 'side');
//Hide the "Listing Address" meta box.
remove_meta_box('_wre_listing_address', $screen->id, 'side');
//Hide the "Listing Settings" meta box.
remove_meta_box('_wre_listing_settings', $screen->id, 'side');
//Hide the "Open For Inspection" meta box.
remove_meta_box('_wre_listing_open', $screen->id, 'side');
//Hide the "Contact Form" meta box.
remove_meta_box('wre_contact_form', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_wp_real_estate_metaboxes', 20);