-
Home
-
Ad Blocks
- Tips
How to Hide Ad Blocks Admin Menus
function plt_hide_ad_blocks_menus() {
//Hide "Ad Blocks Settings".
remove_menu_page('adb_settings');
//Hide "Ad Blocks".
remove_menu_page('edit.php?post_type=adblock');
//Hide "Ad Blocks → Ad Blocks".
remove_submenu_page('edit.php?post_type=adblock', 'edit.php?post_type=adblock');
//Hide "Ad Blocks → Add New Ad Block".
remove_submenu_page('edit.php?post_type=adblock', 'post-new.php?post_type=adblock');
}
add_action('admin_menu', 'plt_hide_ad_blocks_menus', 11);
Where do I put this code?
How to Hide Ad Blocks Meta Boxes
function plt_hide_ad_blocks_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Shortcode options" meta box.
remove_meta_box('metabox_adblock', $screen->id, 'normal');
//Hide the "Auto posting" meta box.
remove_meta_box('metabox_adblock_auto', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_ad_blocks_metaboxes', 20);