-
Home
-
VK All in One Expansion Unit
- Tips
How to Hide VK All in One Expansion Unit Admin Menus
function plt_hide_vk_all_in_one_expansion_unit_menus() {
//Hide "CTA".
remove_menu_page('edit.php?post_type=cta');
//Hide "CTA → CTA".
remove_submenu_page('edit.php?post_type=cta', 'edit.php?post_type=cta');
//Hide "CTA → Add new CTA".
remove_submenu_page('edit.php?post_type=cta', 'post-new.php?post_type=cta');
//Hide "Custom Post Type Setting".
remove_menu_page('edit.php?post_type=post_type_manage');
//Hide "Custom Post Type Setting → Custom Post Type Setting".
remove_submenu_page('edit.php?post_type=post_type_manage', 'edit.php?post_type=post_type_manage');
//Hide "Custom Post Type Setting → Add New Post".
remove_submenu_page('edit.php?post_type=post_type_manage', 'post-new.php?post_type=post_type_manage');
//Hide "ExUnit".
remove_menu_page('vkExUnit_setting_page');
//Hide "ExUnit → Active Setting".
remove_submenu_page('vkExUnit_setting_page', 'vkExUnit_setting_page');
//Hide "ExUnit → Main setting".
remove_submenu_page('vkExUnit_setting_page', 'vkExUnit_main_setting');
//Hide "ExUnit → CSS Customize".
remove_submenu_page('vkExUnit_setting_page', 'vkExUnit_css_customize');
}
add_action('admin_menu', 'plt_hide_vk_all_in_one_expansion_unit_menus', 21);
Where do I put this code?
How to Hide VK All in One Expansion Unit Meta Boxes
function plt_hide_vk_all_in_one_expansion_unit_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "VK All in One Expansion Unit" meta box.
remove_meta_box('veu_parent_post_metabox', $screen->id, 'normal');
//Hide the "Excerpt" meta box.
remove_meta_box('postexcerpt', $screen->id, 'normal');
//Hide the "CTA Contents" meta box.
remove_meta_box('vkExUnit_cta_url', $screen->id, 'normal');
//Hide the "Custom Post Type Setting" meta box.
remove_meta_box('meta_box_post_type_manage', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_vk_all_in_one_expansion_unit_metaboxes', 20);
How to Hide the "Vektor WordPress Information" Dashboard Widget
function plt_hide_vk_all_in_one_expansion_unit_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "Vektor WordPress Information" widget.
remove_meta_box('vk_dashboard_widget', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'plt_hide_vk_all_in_one_expansion_unit_dashboard_widgets', 20);