Skip to content

Instantly share code, notes, and snippets.

@corsonr
Created December 5, 2017 08:37
Show Gist options
  • Save corsonr/12496ebe582663037667b44065eb6f7f to your computer and use it in GitHub Desktop.
Save corsonr/12496ebe582663037667b44065eb6f7f to your computer and use it in GitHub Desktop.
WooCommerce: modify WooCommerce default customer role
<?php // Do not include this if already open! Code goes in theme functions.php.
/**
* woocommerce_custom_new_customer_data
*
* @access public
* @since 1.0
* @return void
*/
function woocommerce_custom_new_customer_data( $new_customer_data ) {
$new_customer_data['role'] = 'subscriber';
return $new_customer_data;
}
add_filter( 'woocommerce_new_customer_data', 'woocommerce_custom_new_customer_data');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment