Title: Custom Address Format
Last modified: September 9, 2020

---

# Custom Address Format

 *  [boroconsulting](https://wordpress.org/support/users/boroconsulting/)
 * (@boroconsulting)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/custom-address-format/)
 * Hi there! I am trying to have a custom address format that would be displayed
   based on the WP ML language that is currently active. We need to have a different
   address format based on the country where our stores are.
 * I was trying to do something like this, but cannot make it work properly, I am
   sure you will know why:
 * add_filter( ‘wpsl_address_format’, ‘custom_address_format’ );
 * function custom_address_format( $address_format ) {
 *  if (ICL_LANGUAGE_CODE == “de”) {
 *  $address_format = ‘zip_city_state’;
    } elseif (ICL_LANGUAGE_CODE == “en”) {
 *  $address_format = ‘city_state_zip’;
    } return apply_filters( ‘wpsl_address_format’,
   $address_format ); }
 * I appreciate your help!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/custom-address-format/#post-13385798)
 * If you change this ‘return apply_filters( ‘wpsl_address_format’, $address_format);
   into this return $address_format;
 * Does that work better?
 * You did check the ‘ICL_LANGUAGE_CODE’ actually contains a value?

Viewing 1 replies (of 1 total)

The topic ‘Custom Address Format’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

## Tags

 * [address format](https://wordpress.org/support/topic-tag/address-format/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/custom-address-format/#post-13385798)
 * Status: not resolved