Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Last active May 17, 2017 01:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bentasm1/22ec814d568fa183840d to your computer and use it in GitHub Desktop.
Save bentasm1/22ec814d568fa183840d to your computer and use it in GitHub Desktop.
WC Vendors - Forcing all new registrations to be Vendors
/* Forces all new registrations to your site on the My Account page to be a Vendor, rather than the Customer role */
add_filter( 'woocommerce_new_customer_data', 'custom_woocommerce_new_customer_data' );
function custom_woocommerce_new_customer_data( $data ){
$data['role'] = 'vendor'; // the new default role
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment