-
Home
-
Banner Slider for Advertisement
- Tips
How to Hide Banner Slider for Advertisement Admin Menus
function plt_hide_banner_slider_for_advertisement_menus() {
//Hide "Banner Slider".
remove_menu_page('edit.php?post_type=wpwbs');
//Hide "Banner Slider → Banner Slider".
remove_submenu_page('edit.php?post_type=wpwbs', 'edit.php?post_type=wpwbs');
//Hide "Banner Slider → Add New Banner Slider".
remove_submenu_page('edit.php?post_type=wpwbs', 'post-new.php?post_type=wpwbs');
//Hide "Banner Slider → Plugin Settings".
remove_submenu_page('edit.php?post_type=wpwbs', 'wpwbs_settings');
}
add_action('admin_menu', 'plt_hide_banner_slider_for_advertisement_menus', 11);
Where do I put this code?
How to Hide the "Banner Slider Settings" Meta Box
function plt_hide_banner_slider_for_advertisement_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Banner Slider Settings" meta box.
remove_meta_box('wpbsc_sectionid', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_banner_slider_for_advertisement_metaboxes', 20);