-
Home
-
JM Breaking News
- Tips
How to Hide JM Breaking News Admin Menus
function plt_hide_jm_breaking_news_menus() {
//Hide the "Breaking News" menu.
remove_menu_page('edit.php?post_type=jm_breaking_news');
//Hide the "Breaking News → All Breaking News Items" menu.
remove_submenu_page('edit.php?post_type=jm_breaking_news', 'edit.php?post_type=jm_breaking_news');
//Hide the "Breaking News → Add New" menu.
remove_submenu_page('edit.php?post_type=jm_breaking_news', 'post-new.php?post_type=jm_breaking_news');
}
add_action('admin_menu', 'plt_hide_jm_breaking_news_menus', 11);
Where do I put this code?
How to Hide the "Breaking News Info" Meta Box
function plt_hide_jm_breaking_news_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Breaking News Info" meta box.
remove_meta_box('jm-breaking-news-meta', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_jm_breaking_news_metaboxes', 20);