Title: Display Address
Last modified: October 25, 2016

---

# Display Address

 *  Resolved [MistaDan](https://wordpress.org/support/users/mistadan/)
 * (@mistadan)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/display-address-2/)
 * Hi,
    I need to display company name from the address array built from the user’s
   profile fields. I need to display the company name in the customer-pages-contextual-
   toolbar.template.php. I have poured over the forum and google and can’t find 
   anything of use. I would think it should be relatively easy, but the way it is
   called in account-view-address.template.php doesn’t make sense to me. How does
   one access this data?
 * Thanks
    -  This topic was modified 9 years, 7 months ago by [MistaDan](https://wordpress.org/support/users/mistadan/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [MistaDan](https://wordpress.org/support/users/mistadan/)
 * (@mistadan)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/display-address-2/#post-8355592)
 * Not sure if there was an easier way, but I ended up sticking this at the top 
   of customer-pages-contextual-toolbar.template.php (for anyone else who might 
   want to do this).
 *     ```
       <?php $address = new CUAR_AddressesAddOn; ?>
       <?php $current_user = wp_get_current_user(); ?>
       <?php $address_id = $address->get_registered_user_addresses(); ?>
       <?php $address_id = array_keys( $address_id ); ?>
       <?php $address = $address->get_owner_address('usr', array($current_user->ID), $address_id[0]); ?>
       ```
   
 * and then get the company from the resulting array
 * `$address['company']`
 * NOTE: Concerning $address_id, I ditched business address, so I only have one 
   address id to deal with.
    -  This reply was modified 9 years, 7 months ago by [MistaDan](https://wordpress.org/support/users/mistadan/).
    -  This reply was modified 9 years, 7 months ago by [MistaDan](https://wordpress.org/support/users/mistadan/).
 *  Plugin Contributor [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * (@vprat)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/display-address-2/#post-8360432)
 * Here is a shorter way to get the current user address:
 *     ```
       <?php
       $ad_addon = cuar_addon('address-manager');
       $address = $ad_addon->$this->get_owner_address('usr', array(get_current_user_id(), CUAR_AddressHelper::$DEFAULT_HOME_ADDRESS_ID);
       ?>
       ```
   
    -  This reply was modified 9 years, 7 months ago by [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Display Address’ is closed to new replies.

 * ![](https://ps.w.org/customer-area/assets/icon-256x256.png?rev=1288039)
 * [WP Customer Area](https://wordpress.org/plugins/customer-area/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/customer-area/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/customer-area/)
 * [Active Topics](https://wordpress.org/support/plugin/customer-area/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/customer-area/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/customer-area/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/display-address-2/#post-8360432)
 * Status: resolved