title: Add a custom field in Woocommerce Edit Account page
body: <p>I have custom checkout fields <code>favorite_color</code> that users can fill in during checkout <em>(not required)</em>,imilar to other default checkout fields...</p>
  
  <p>In My Account section in "Edit Account", I Would like to add <code>favorite_color</code> custom field to allow customer editing this field value.</p>
  
  <p>For that I have edited the template <code>myaccount/form-edit-account.php</code> by copying and editing an original line of code in it:</p>
  
  <pre><code>    &lt;p class="woocommerce-form-row woocommerce-form-row--first form-row form-row-first"&gt;
      &lt;label for="account_first_name"&gt;&lt;?php _e( 'First name', 'woocommerce' ); ?&gt; &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
      &lt;input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="account_first_name" id="account_first_name" value="&lt;?php echo esc_attr( $user-&gt;first_name ); ?&gt;" /&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I replaced the <strong>account_first_name</strong> with my <strong>favorite_color</strong> and the field even shows the saved value in the field (thanks to <code>$user-&gt;favorite_color</code>)</p>
  
  <p>But the bad part is, it does not get saved.</p>
  
  <p>What code must I add to get this working and getting saved?</p>
  
  <p>The original template code is: </p>
  
  <pre><code>&lt;?php
  /**
   * Edit account form
   *
   * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-edit-account.php.
   *
   * HOWEVER, on occasion WooCommerce will need to update template files and you
   * (the theme developer) will need to copy the new files to your theme to
   * maintain compatibility. We try to do this as little as possible, but it does
   * happen. When this occurs the version of the template file will be bumped and
   * the readme will list any important changes.
   *
   * @see     https://docs.woocommerce.com/document/template-structure/
   * @author  WooThemes
   * @package WooCommerce/Templates
   * @version 2.6.0
   */
  
  if ( ! defined( 'ABSPATH' ) ) {
      exit;
  }
  
  do_action( 'woocommerce_before_edit_account_form' ); ?&gt;
  
  &lt;form class="woocommerce-EditAccountForm edit-account" action="" method="post"&gt;
  
      &lt;?php do_action( 'woocommerce_edit_account_form_start' ); ?&gt;
  
      &lt;p class="woocommerce-form-row woocommerce-form-row--first form-row form-row-first"&gt;
          &lt;label for="account_first_name"&gt;&lt;?php _e( 'First name', 'woocommerce' ); ?&gt; &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="account_first_name" id="account_first_name" value="&lt;?php echo esc_attr( $user-&gt;first_name ); ?&gt;" /&gt;
      &lt;/p&gt;
      &lt;p class="woocommerce-form-row woocommerce-form-row--last form-row form-row-last"&gt;
          &lt;label for="account_last_name"&gt;&lt;?php _e( 'Last name', 'woocommerce' ); ?&gt; &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="account_last_name" id="account_last_name" value="&lt;?php echo esc_attr( $user-&gt;last_name ); ?&gt;" /&gt;
      &lt;/p&gt;
      &lt;div class="clear"&gt;&lt;/div&gt;
  
      &lt;p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"&gt;
          &lt;label for="account_email"&gt;&lt;?php _e( 'Email address', 'woocommerce' ); ?&gt; &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input type="email" class="woocommerce-Input woocommerce-Input--email input-text" name="account_email" id="account_email" value="&lt;?php echo esc_attr( $user-&gt;user_email ); ?&gt;" /&gt;
      &lt;/p&gt;
  
      &lt;fieldset&gt;
          &lt;legend&gt;&lt;?php _e( 'Password change', 'woocommerce' ); ?&gt;&lt;/legend&gt;
  
          &lt;p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"&gt;
              &lt;label for="password_current"&gt;&lt;?php _e( 'Current password (leave blank to leave unchanged)', 'woocommerce' ); ?&gt;&lt;/label&gt;
              &lt;input type="password" class="woocommerce-Input woocommerce-Input--password input-text" name="password_current" id="password_current" /&gt;
          &lt;/p&gt;
          &lt;p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"&gt;
              &lt;label for="password_1"&gt;&lt;?php _e( 'New password (leave blank to leave unchanged)', 'woocommerce' ); ?&gt;&lt;/label&gt;
              &lt;input type="password" class="woocommerce-Input woocommerce-Input--password input-text" name="password_1" id="password_1" /&gt;
          &lt;/p&gt;
          &lt;p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"&gt;
              &lt;label for="password_2"&gt;&lt;?php _e( 'Confirm new password', 'woocommerce' ); ?&gt;&lt;/label&gt;
              &lt;input type="password" class="woocommerce-Input woocommerce-Input--password input-text" name="password_2" id="password_2" /&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
      &lt;div class="clear"&gt;&lt;/div&gt;
  
      &lt;?php do_action( 'woocommerce_edit_account_form' ); ?&gt;
  
      &lt;p&gt;
          &lt;?php wp_nonce_field( 'save_account_details' ); ?&gt;
          &lt;input type="submit" class="woocommerce-Button button" name="save_account_details" value="&lt;?php esc_attr_e( 'Save changes', 'woocommerce' ); ?&gt;" /&gt;
          &lt;input type="hidden" name="action" value="save_account_details" /&gt;
      &lt;/p&gt;
  
      &lt;?php do_action( 'woocommerce_edit_account_form_end' ); ?&gt;
  &lt;/form&gt;
  
  &lt;?php do_action( 'woocommerce_after_edit_account_form' ); ?&gt;
  </code></pre>