-
Home
-
WPPizza – A Restaurant Plugin
- Tips
How to Hide WPPizza Admin Menus
function plt_hide_wppizza_menus() {
//Hide "WPPizza".
remove_menu_page('edit.php?post_type=wppizza');
//Hide "WPPizza → All Menu Items".
remove_submenu_page('edit.php?post_type=wppizza', 'edit.php?post_type=wppizza');
//Hide "WPPizza → Add New Menu Item".
remove_submenu_page('edit.php?post_type=wppizza', 'post-new.php?post_type=wppizza');
//Hide "WPPizza → Categories".
remove_submenu_page('edit.php?post_type=wppizza', 'edit-tags.php?taxonomy=wppizza_menu&post_type=wppizza');
//Hide "WPPizza → Settings".
remove_submenu_page('edit.php?post_type=wppizza', 'settings');
//Hide "WPPizza → Order Settings".
remove_submenu_page('edit.php?post_type=wppizza', 'order_settings');
//Hide "WPPizza → Order Form".
remove_submenu_page('edit.php?post_type=wppizza', 'order_form');
//Hide "WPPizza → Opening Times".
remove_submenu_page('edit.php?post_type=wppizza', 'openingtimes');
//Hide "WPPizza → Gateways".
remove_submenu_page('edit.php?post_type=wppizza', 'gateways');
//Hide "WPPizza → Meal Sizes".
remove_submenu_page('edit.php?post_type=wppizza', 'meal_sizes');
//Hide "WPPizza → Additives".
remove_submenu_page('edit.php?post_type=wppizza', 'additives');
//Hide "WPPizza → Layout".
remove_submenu_page('edit.php?post_type=wppizza', 'layout');
//Hide "WPPizza → Localization".
remove_submenu_page('edit.php?post_type=wppizza', 'localization');
//Hide "WPPizza → Order History".
remove_submenu_page('edit.php?post_type=wppizza', 'orderhistory');
//Hide "WPPizza → Templates".
remove_submenu_page('edit.php?post_type=wppizza', 'templates');
//Hide "WPPizza → Reports".
remove_submenu_page('edit.php?post_type=wppizza', 'reports');
//Hide "WPPizza → Customers".
remove_submenu_page('edit.php?post_type=wppizza', 'customers');
//Hide "WPPizza → Access Rights".
remove_submenu_page('edit.php?post_type=wppizza', 'access_rights');
//Hide "WPPizza → Tools".
remove_submenu_page('edit.php?post_type=wppizza', 'tools');
}
add_action('admin_menu', 'plt_hide_wppizza_menus', 141);
Where do I put this code?
How to Hide the "WPPizza Options" Meta Box
function plt_hide_wppizza_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "WPPizza Options" meta box.
remove_meta_box('wppizza', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_wppizza_metaboxes', 20);
How to Hide the "WPPizza Overview - updated hourly" Dashboard Widget
function plt_hide_wppizza_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "WPPizza Overview - updated hourly" widget.
remove_meta_box('wppizza_dashboard_widget', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'plt_hide_wppizza_dashboard_widgets', 20);