Skip to content

Instantly share code, notes, and snippets.

@lucasstark
Created November 25, 2014 12:37
Show Gist options
  • Save lucasstark/1c77f8c724df61d5d2d3 to your computer and use it in GitHub Desktop.
Save lucasstark/1c77f8c724df61d5d2d3 to your computer and use it in GitHub Desktop.
add_filter('woocommerce_catalog_restrictions_get_roles_for_current_user', 'custom_woocommerce_catalog_restrictions_get_roles_for_current_user');
function custom_woocommerce_catalog_restrictions_get_roles_for_current_user($roles){
if ( current_user_can( 'wholesale_user')) {
unset($roles['guest']);
}
return $roles;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment