From f58f8672cca8364cf7e2a4479f45cae89af396f1 Mon Sep 17 00:00:00 2001 From: claudiosmweb Date: Tue, 11 Feb 2014 17:50:55 -0200 Subject: [PATCH] prevents automatic password generation when making the registration in the My Account page, closes #4672 --- includes/wc-customer-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-customer-functions.php b/includes/wc-customer-functions.php index 00ad7bcfed5..5b8a65de541 100644 --- a/includes/wc-customer-functions.php +++ b/includes/wc-customer-functions.php @@ -73,7 +73,7 @@ function wc_create_new_customer( $email, $username = '', $password = '' ) { } // Handle password creation - if ( get_option( 'woocommerce_registration_generate_password' ) == 'yes' && empty( $password ) ) { + if ( get_option( 'woocommerce_registration_generate_password' ) == 'yes' && empty( $password ) && ! isset( $_POST['register'] ) ) { $password = wp_generate_password(); $password_generated = true; } elseif ( empty( $password ) ) {