-
Home
-
Age Gate
- Tips
How to Hide Age Gate Admin Menus
function plt_hide_age_gate_menus() {
//Hide "Age Gate".
remove_menu_page('age-gate');
//Hide "Age Gate → Restrictions".
remove_submenu_page('age-gate', 'age-gate');
//Hide "Age Gate → Messages".
remove_submenu_page('age-gate', 'age-gate-message');
//Hide "Age Gate → Appearance".
remove_submenu_page('age-gate', 'age-gate-appearance');
//Hide "Age Gate → Advanced".
remove_submenu_page('age-gate', 'age-gate-advanced');
//Hide "Age Gate → Access".
remove_submenu_page('age-gate', 'age-gate-access');
//Hide "Age Gate → Content".
remove_submenu_page('age-gate', 'age-gate-content');
//Hide "Age Gate → Tools".
remove_submenu_page('age-gate', 'age-gate-tools');
//Hide "Age Gate → Troubleshooting".
remove_submenu_page('age-gate', 'age-gate-troubleshooting');
}
add_action('admin_menu', 'plt_hide_age_gate_menus', 11);
Where do I put this code?
How to Hide the "Age Gate" Meta Box
function plt_hide_age_gate_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Age Gate" meta box.
remove_meta_box('age_gate', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_age_gate_metaboxes', 20);