Created
December 5, 2017 08:37
-
-
Save corsonr/12496ebe582663037667b44065eb6f7f to your computer and use it in GitHub Desktop.
WooCommerce: modify WooCommerce default customer role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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