Merge pull request #23468 from woocommerce/update/23366
Return WP_Error messages from wp_insert_user()
This commit is contained in:
commit
fbdfb7b87f
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue