I am trying to remove some menu items for my ShopManager to simplify her admin portal and also restrict access to certain features.
I managed to remove some items from the Woocommerce menu.
However, for some reason I am unable to remove items from the Bookings menu.
I would like to remove the following menu items: resources, add product, and settings.
Here is the like i used to remove the resources menu item but it isnt working:
<code>function customize_shop_manager_dashboard_and_menus() {
// Remove specific WooCommerce sub-menu items from WOOCOMMERCE DROP DOWN
remove_submenu_page('woocommerce', 'wc-admin&path=/customers'); // Customers
remove_submenu_page('woocommerce', 'wc-admin&path=/extensions'); // Extensions
remove_submenu_page('woocommerce', 'wc-settings'); // Settings
remove_submenu_page('woocommerce', 'wc-status'); // Status
remove_submenu_page('woocommerce', 'wc-extensions'); // Extensions
remove_submenu_page('wc_bookings', 'edit.php?post_type=bookable_resource');
// Hook the function into the appropriate actions
add_action('admin_menu', 'customize_shop_manager_dashboard_and_menus', 110);
<code>function customize_shop_manager_dashboard_and_menus() {
//WORKING FINE
// Remove specific WooCommerce sub-menu items from WOOCOMMERCE DROP DOWN
remove_submenu_page('woocommerce', 'wc-admin&path=/customers'); // Customers
remove_submenu_page('woocommerce', 'wc-admin&path=/extensions'); // Extensions
remove_submenu_page('woocommerce', 'wc-settings'); // Settings
remove_submenu_page('woocommerce', 'wc-status'); // Status
remove_submenu_page('woocommerce', 'wc-extensions'); // Extensions
// NOT WORKING
remove_submenu_page('wc_bookings', 'edit.php?post_type=bookable_resource');
}
// Hook the function into the appropriate actions
add_action('admin_menu', 'customize_shop_manager_dashboard_and_menus', 110);
</code>
function customize_shop_manager_dashboard_and_menus() {
//WORKING FINE
// Remove specific WooCommerce sub-menu items from WOOCOMMERCE DROP DOWN
remove_submenu_page('woocommerce', 'wc-admin&path=/customers'); // Customers
remove_submenu_page('woocommerce', 'wc-admin&path=/extensions'); // Extensions
remove_submenu_page('woocommerce', 'wc-settings'); // Settings
remove_submenu_page('woocommerce', 'wc-status'); // Status
remove_submenu_page('woocommerce', 'wc-extensions'); // Extensions
// NOT WORKING
remove_submenu_page('wc_bookings', 'edit.php?post_type=bookable_resource');
}
// Hook the function into the appropriate actions
add_action('admin_menu', 'customize_shop_manager_dashboard_and_menus', 110);
Any help is appreciated, thank you 🙂