title: Updating WordPress account email with WooCommerce billing email after checkout
body: <p>I need update WordPress account email with woocommerce billing email after successful checkouts. I  used this code but it does not work :</p>
  <pre><code>/* Update account email based on woocommerce billing email */
  
  
  add_filter( 'woocommerce_thankyou' , 'custom_update_checkout_fields', 10, 2 );
  
   function custom_update_checkout_fields($user_id, $old_user_data ) {
    $current_user = wp_get_current_user();
    
    // Updating Billing info
    
    if($current_user-&gt;user_email != $current_user-&gt;billing_email)
      update_user_meta($user_id, 'billing_email', $current_user-&gt;user_email);
  }
  </code></pre>
  <p>Am I used an outdated code?</p>