Skip to content

Instantly share code, notes, and snippets.

@fervous
Forked from bentasm1/functions.php
Last active May 17, 2017 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fervous/b47ee7de79bf13455e7875bf240130c0 to your computer and use it in GitHub Desktop.
Save fervous/b47ee7de79bf13455e7875bf240130c0 to your computer and use it in GitHub Desktop.
WC Vendors - Forcing all new registrations to be Vendors ( default ) if my-account registration is used
/* By default Registrations to your site using the My Account = Vendor role, 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