title: How to change the added phone value in edit-account template form?
body: <p>I needed to add fields 'firstname','lastname' and 'phone' to the register woocommerce form.
  I've found that decision.</p>
  <pre><code>function wooc_extra_register_fields() {?&gt;
           &lt;div class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide form-group&quot;&gt;           
             &lt;input type=&quot;text&quot; name=&quot;billing_first_name&quot; id=&quot;reg_billing_first_name&quot; value=&quot;&lt;?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?&gt;&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text form-control&quot; size=&quot;25&quot; placeholder=&quot;&lt;?php _e( 'First Name', 'mydomain' ) ?&gt;&quot; /&gt;
          &lt;/div&gt;
          &lt;div class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide form-group&quot;&gt;       
              &lt;input type=&quot;text&quot; name=&quot;billing_last_name&quot; id=&quot;reg_billing_last_name&quot; value=&quot;&lt;?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?&gt;&quot; placeholder=&quot;&lt;?php _e( 'Last Name', 'mydomain' ) ?&gt;&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text form-control&quot; size=&quot;25&quot; /&gt;
          &lt;/div&gt;
  
           &lt;div class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide form-group&quot;&gt;       
              &lt;input type=&quot;text&quot; name=&quot;billing_phone&quot; id=&quot;reg_billing_phone&quot; placeholder=&quot;&lt;?php _e( 'Phone', 'woocommerce' ); ?&gt;&quot; value=&quot;&lt;?php esc_attr_e( $_POST['billing_phone'] ); ?&gt;&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text form-control&quot; size=&quot;25&quot; /&gt;
          &lt;/div&gt;
   
         &lt;?php
   }
   add_action( 'woocommerce_register_form_start', 'wooc_extra_register_fields' );
  
   /**
  
  * register fields Validating.
  
  */
  
  function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) {
  
        if ( isset( $_POST['billing_first_name'] ) &amp;&amp; empty( $_POST['billing_first_name'] ) ) {
  
               $validation_errors-&gt;add( 'billing_first_name_error', __( '&lt;strong&gt;Error&lt;/strong&gt;: First name is required!', 'woocommerce' ) );
  
        }
  
        if ( isset( $_POST['billing_last_name'] ) &amp;&amp; empty( $_POST['billing_last_name'] ) ) {
  
               $validation_errors-&gt;add( 'billing_last_name_error', __( '&lt;strong&gt;Error&lt;/strong&gt;: Last name is required!.', 'woocommerce' ) );
  
        }
  
  
        if ( isset( $_POST['billing_phone'] ) &amp;&amp; empty( $_POST['billing_phone'] ) ) {
  
               $validation_errors-&gt;add( 'billing_phone_error', __( '&lt;strong&gt;Error&lt;/strong&gt;: Phone is required!.', 'woocommerce' ) );
  
        }
  
           return $validation_errors;
  }
  
  add_action( 'woocommerce_register_post', 'wooc_validate_extra_register_fields', 10, 3 );
  /**
  * Below code save extra fields.
  */
  function wooc_save_extra_register_fields( $customer_id ) {
      if ( isset( $_POST['billing_phone'] ) ) {
                   // Phone input filed which is used in WooCommerce
                   update_user_meta( $customer_id, 'billing_phone', sanitize_text_field( $_POST['billing_phone'] ) );
            }
        if ( isset( $_POST['billing_first_name'] ) ) {
               //First name field which is by default
               update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
               // First name field which is used in WooCommerce
               update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
        }
        if ( isset( $_POST['billing_last_name'] ) ) {
               // Last name field which is by default
               update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );
               // Last name field which is used in WooCommerce
               update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );      }
  
  }
  add_action( 'woocommerce_created_customer', 'wooc_save_extra_register_fields' ); 
  </code></pre>
  <p>In myaccount form-edit-account.php template it looks like that</p>
  <pre><code>&lt;form class=&quot;woocommerce-EditAccountForm edit-account&quot; action=&quot;&quot; method=&quot;post&quot; &lt;?php do_action( 'woocommerce_edit_account_form_tag' ); ?&gt; &gt;
  
     &lt;?php do_action( 'woocommerce_edit_account_form_start' ); ?&gt;
  
     &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--first form-row form-row-first page-inside-p&quot;&gt;
         &lt;input type=&quot;text&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text form-control&quot; name=&quot;account_first_name&quot; id=&quot;account_first_name&quot; autocomplete=&quot;given-name&quot; value=&quot;&lt;?php echo esc_attr( $user-&gt;first_name ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_html_e( 'First name', 'woocommerce' ); ?&gt;&quot; /&gt;
     &lt;/p&gt;
     &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--last form-row form-row-last page-inside-p&quot;&gt;        
         &lt;input type=&quot;text&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text form-control&quot; name=&quot;account_last_name&quot; id=&quot;account_last_name&quot; autocomplete=&quot;family-name&quot; value=&quot;&lt;?php echo esc_attr( $user-&gt;last_name ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_html_e( 'Last name', 'woocommerce' ); ?&gt;&quot; /&gt;
     &lt;/p&gt;
     &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
  
     &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide page-inside-p&quot;&gt;        
         &lt;input type=&quot;text&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text form-control&quot; name=&quot;account_display_name&quot; id=&quot;account_display_name&quot; value=&quot;&lt;?php echo esc_attr( $user-&gt;display_name ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_html_e( 'Display name', 'woocommerce' ); ?&gt;&quot; /&gt; 
     &lt;/p&gt;
     &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
  
     &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide mb-20 page-inside-p&quot;&gt;      
         &lt;input type=&quot;email&quot; class=&quot;woocommerce-Input woocommerce-Input--email input-text form-control&quot; name=&quot;account_email&quot; id=&quot;account_email&quot; autocomplete=&quot;email&quot; value=&quot;&lt;?php echo esc_attr( $user-&gt;user_email ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_html_e( 'Email address', 'woocommerce' ); ?&gt;&quot; /&gt;
     &lt;/p&gt;
  
          &lt;div class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide form-group&quot;&gt;       
             &lt;input type=&quot;text&quot; name=&quot;billing_phone&quot; id=&quot;reg_billing_phone&quot; placeholder=&quot;&lt;?php _e( 'Phone', 'woocommerce' ); ?&gt;&quot; value=&quot;&lt;?php esc_attr_e( $_POST['billing_phone'] ); ?&gt;&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text form-control&quot; size=&quot;25&quot; /&gt;
         &lt;/div&gt;....etc
  </code></pre>
  <p>The first name and the last name are can be changed correctly, but I don't see the value of a phone number in that page and can't update it to save. What's the right way to do it? I copied the same phone field as in the register form, but it seems that's a wrong way. How to display and change it correctly?</p>