Hide account tab to certain users

I’m not sure what the snippet you used is, but you can wrap it in an if statement like this:

if(in_array('wholesaler', wp_get_current_user()->roles)) {
    // Your snippet here
}

This will only run the snippet that adds that tab when the user that is logged in has the wholesaler role. Be sure to replace wholesaler with whatever the slug of that role is on your website.

Edit:

If you want to check multiple arrays, you can just do this:

$roles = wp_get_current_user()->roles;
if(in_array('wholesaler', $roles) || in_array('administrator', $roles)) {
    // Your snippet here
}

If you have more than two roles you want to check, here’s an answer on how to check multiple values with in_array.

tech