Skip to content

Instantly share code, notes, and snippets.

@tamarazuk
Created January 22, 2016 06:28
Show Gist options
  • Save tamarazuk/01cb15215cb512481a8d to your computer and use it in GitHub Desktop.
Save tamarazuk/01cb15215cb512481a8d to your computer and use it in GitHub Desktop.
WooCommerce Social Login: Customize user date
<?php // only copy this line if needed
function sv_wc_social_login_new_user_data_add_filters() {
foreach ( array_keys( wc_social_login()->get_available_providers() ) as $provider ) {
add_filter( 'wc_social_login_' . $provider . '_new_user_data', 'sv_wc_social_login_new_user_data' );
}
}
add_action( 'init', 'sv_wc_social_login_new_user_data_add_filters' );
function sv_wc_social_login_new_user_data( $user_data ) {
$user_data['role'] = 'custom_role_here';
return $user_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment