Hi,
I hope you are doing well today. By default, the menu will not be displayed for the Shop Manager role. Please check this screenshot for a better understanding- https://prnt.sc/2zsQCrf3eHME
If you check the screenshot, you can see our Plugin Menu is not displayed at the left menu bar. The test is a Shop Manager. However, here is an example snippet to hide the menu for the Administrator and Shop Manager:
add_action( 'admin_init', 'remove_menus' );
function remove_menus(){
$user = wp_get_current_user();
$not_allowed_roles = array( 'shop_manager', 'administrator' );
if ( array_intersect( $not_allowed_roles, $user->roles ) ) {
// Stuff here for not_allowed_roles array
remove_submenu_page('wpxtension', 'variation-price-display');
}
}
Hope to hear from you soon.
Best Regards
Thank, it works:
function custom_remove_menu_items() {
if (current_user_can(‘shop_manager’)) {
remove_menu_page(‘wpxtension’, ‘variation-price-display’);}
}
add_action(‘admin_menu’, ‘custom_remove_menu_items’, 999);
Hi,
I am very glad that that helps.
If you found my support helpful, can you please share your feedback here- https://ww.wp.xz.cn/support/plugin/variation-price-display/reviews/.
It will help us to grow and inspire us a lot.
Best Regards