title: WooCommerce how to edit address
body: <p>I am having difficulties in editing a new address type in WooCommerce. I added besides shipping and billing, another type of address, personal.</p>
  
  <p>I want the user to change the data on his <strong>my account/edit my address</strong> page.</p>
  
  <p>I can perfectly show the data for personal address, but when the user clicks on <strong>edit</strong>, it should load the form for these fields.</p>
  
  <p>These are the files:</p>
  
  <p><strong>my-account.php</strong></p>
  
  <pre><code>&lt;?php
  /**
   * My Addresses
   *
   * @author      WooThemes
   * @package     WooCommerce/Templates
   * @version     2.0.0
   */
  
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  
  global $woocommerce;
  
  $customer_id = get_current_user_id();
  
  if ( get_option('woocommerce_ship_to_billing_address_only') == 'no' ) {
      $page_title = apply_filters( 'woocommerce_my_account_my_address_title', __( 'My Addresses', 'woocommerce' ) );
      $get_addresses    = array(
          //Added PD
          'personal' =&gt; __( 'Personal Address', 'woocommerce' ),
          //
          'billing' =&gt; __( 'Billing Address', 'woocommerce' ),
  
          'shipping' =&gt; __( 'Shipping Address', 'woocommerce' )
      );
  } else {
      $page_title = apply_filters( 'woocommerce_my_account_my_address_title', __( 'My Address', 'woocommerce' ) );
      $get_addresses    = array(
          'billing' =&gt;  __( 'Billing Address', 'woocommerce' ),
          // Added PD
          'personal' =&gt; __( 'Personal Address', 'woocommerce' )
          //
      );
  }
  
  $col = 1;
  ?&gt;
  
  &lt;h2&gt;&lt;?php echo $page_title; ?&gt;&lt;/h2&gt;
  
  &lt;p class="myaccount_address"&gt;
      &lt;?php echo apply_filters( 'woocommerce_my_account_my_address_description', __( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ) ); ?&gt;
  &lt;/p&gt;
  
  &lt;?php if ( get_option('woocommerce_ship_to_billing_address_only') == 'no' ) echo '&lt;div class="col2-set addresses"&gt;'; ?&gt;
  
  &lt;?php foreach ( $get_addresses as $name =&gt; $title ) : ?&gt;
  
      &lt;div class="col-&lt;?php echo ( ( $col = $col * -1 ) &lt; 0 ) ? 1 : 2; ?&gt; address"&gt;
          &lt;header class="title"&gt;
              &lt;h3&gt;&lt;?php echo $title; ?&gt;&lt;/h3&gt;
              &lt;a href="&lt;?php echo esc_url( add_query_arg('address', $name, get_permalink(woocommerce_get_page_id( 'edit_address' ) ) ) ); ?&gt;" class="edit"&gt;&lt;?php _e( 'Edit', 'woocommerce' ); ?&gt;&lt;/a&gt;
          &lt;/header&gt;
          &lt;address&gt;
              &lt;?php
                  $address = apply_filters( 'woocommerce_my_account_my_address_formatted_address', array(
                      'first_name'    =&gt; get_user_meta( $customer_id, $name . '_first_name', true ),
                      'last_name'     =&gt; get_user_meta( $customer_id, $name . '_last_name', true ),
                      'company'       =&gt; get_user_meta( $customer_id, $name . '_company', true ),
                      'address_1'     =&gt; get_user_meta( $customer_id, $name . '_address_1', true ),
                      'address_2'     =&gt; get_user_meta( $customer_id, $name . '_address_2', true ),
                      'city'          =&gt; get_user_meta( $customer_id, $name . '_city', true ),
                      'state'         =&gt; get_user_meta( $customer_id, $name . '_state', true ),
                      'postcode'      =&gt; get_user_meta( $customer_id, $name . '_postcode', true ),
                      'country'       =&gt; get_user_meta( $customer_id, $name . '_country', true )
                  ), $customer_id, $name );
  
                  $formatted_address = $woocommerce-&gt;countries-&gt;get_formatted_address( $address );
  
                  if ( ! $formatted_address )
                      _e( 'You have not set up this type of address yet.', 'woocommerce' );
                  else
                      echo $formatted_address;
              ?&gt;
          &lt;/address&gt;
      &lt;/div&gt;
  
  &lt;?php endforeach; ?&gt;
  
  &lt;?php if ( get_option('woocommerce_ship_to_billing_address_only') == 'no' ) echo '&lt;/div&gt;'; ?&gt;
  </code></pre>