-
Home
-
ZIP Code Based Content Protection
- Tips
How to Hide ZIP Code Based Content Protection Admin Menus
function plt_hide_zip_code_based_content_protection_menus() {
//Hide "ZBCP".
remove_menu_page('zbcp');
//Hide "ZBCP → ZBCP".
remove_submenu_page('zbcp', 'zbcp');
//Hide "ZBCP → Requested ZIP Codes".
remove_submenu_page('zbcp', 'zbcp-requests');
//Hide "ZBCP → User Requests".
remove_submenu_page('zbcp', 'zbcp-users-requests');
//Hide "ZBCP → Settings".
remove_submenu_page('zbcp', 'zbcp-settings');
}
add_action('admin_menu', 'plt_hide_zip_code_based_content_protection_menus', 101);
Where do I put this code?
How to Hide the "ZIP Code Based Content Protection" Meta Box
function plt_hide_zip_code_based_content_protection_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "ZIP Code Based Content Protection" meta box.
remove_meta_box('global-post-page-zipcode-selector', $screen->id, 'advanced');
}
add_action('add_meta_boxes', 'plt_hide_zip_code_based_content_protection_metaboxes', 20);