Set customer role for user if it not a customer on the current blog

This commit is contained in:
Daniel Hüsken 2016-11-24 13:52:54 +01:00
parent a0f08bb627
commit 89026327b8
1 changed files with 4 additions and 0 deletions

View File

@ -403,6 +403,10 @@ class WC_REST_Customers_Controller extends WC_REST_Controller {
$user_data = get_userdata( $customer->get_id() ); $user_data = get_userdata( $customer->get_id() );
$this->update_additional_fields_for_object( $user_data, $request ); $this->update_additional_fields_for_object( $user_data, $request );
if ( ! is_user_member_of_blog( $user_data->ID ) ) {
$user_data->add_role( 'customer' );
}
/** /**
* Fires after a customer is created or updated via the REST API. * Fires after a customer is created or updated via the REST API.
* *