Fixed method return value in write context

This commit is contained in:
Claudio Sanches 2016-11-23 12:41:40 -02:00
parent 8d19832937
commit bdb863cef1
1 changed files with 2 additions and 2 deletions

View File

@ -144,8 +144,8 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat
*/
public function update( &$customer ) {
wp_update_user( array( 'ID' => $customer->get_id(), 'user_email' => $customer->get_email() ) );
// Only update password if a new one was set with set_password
if ( ! empty( $customer->get_password() ) ) {
// Only update password if a new one was set with set_password.
if ( $customer->get_password() ) {
wp_update_user( array( 'ID' => $customer->get_id(), 'user_pass' => $customer->get_password() ) );
$customer->set_password( '' );
}