-
Home
-
YMC Crossword
- Tips
How to Hide YMC Crossword Admin Menus
function plt_hide_ymc_crossword_menus() {
//Hide the "Crossword" menu.
remove_menu_page('edit.php?post_type=ymc_crossword');
//Hide the "Crossword → Crossword" menu.
remove_submenu_page('edit.php?post_type=ymc_crossword', 'edit.php?post_type=ymc_crossword');
//Hide the "Crossword → Add New Post" menu.
remove_submenu_page('edit.php?post_type=ymc_crossword', 'post-new.php?post_type=ymc_crossword');
}
add_action('admin_menu', 'plt_hide_ymc_crossword_menus', 15);
Where do I put this code?
How to Hide YMC Crossword Meta Boxes
function plt_hide_ymc_crossword_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Settings Crossword" meta box.
remove_meta_box('ymc_crossword_top_meta_box', $screen->id, 'normal');
//Hide the "YMC Crossword" meta box.
remove_meta_box('ymc_crossword_side_meta_box', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_ymc_crossword_metaboxes', 20);