Merge pull request #23468 from woocommerce/update/23366

Return WP_Error messages from wp_insert_user()
This commit is contained in:
Rodrigo Primo 2019-05-21 17:10:32 -03:00 committed by GitHub
commit fbdfb7b87f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ if ( ! function_exists( 'wc_create_new_customer' ) ) {
$customer_id = wp_insert_user( $new_customer_data );
if ( is_wp_error( $customer_id ) ) {
return new WP_Error( 'registration-error', __( 'Couldn’t register you… please contact us if you continue to have problems.', 'woocommerce' ) );
return $customer_id;
}
do_action( 'woocommerce_created_customer', $customer_id, $new_customer_data, $password_generated );