-
Home
-
Site Notices WP
- Tips
How to Hide Site Notices WP Admin Menus
function plt_hide_site_notices_wp_menus() {
//Hide the "Notices" menu.
remove_menu_page('edit.php?post_type=alsvin-site-notice');
//Hide the "Notices → All Notices" menu.
remove_submenu_page('edit.php?post_type=alsvin-site-notice', 'edit.php?post_type=alsvin-site-notice');
//Hide the "Notices → Add New Notice" menu.
remove_submenu_page('edit.php?post_type=alsvin-site-notice', 'post-new.php?post_type=alsvin-site-notice');
}
add_action('admin_menu', 'plt_hide_site_notices_wp_menus', 15);
Where do I put this code?
How to Hide the "Notice Details" Meta Box
function plt_hide_site_notices_wp_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Notice Details" meta box.
remove_meta_box('site-notices-wp-fields', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_site_notices_wp_metaboxes', 20);