Skip Navigation

[Resuelto] Can I display just the state and country name from an address field?

This support ticket is created hace 6 años, 7 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Etiquetado: ,

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Christian Cox hace 6 años, 7 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#706357

I would like to display content specific to a user's home state and country, and I would prefer to have them enter their home address using the address field type so I can take advantage of map options. However, to pull up the state-specific information I need to filter a view based on the user's state. Is there a way to parse out just the state name and country name (separately) and send it to the view that would avoid me having to create redundant fields in the user field group for "state" and "country"? Thanks.

- Aaron

#710746

Hi, when an address is geocoded we store the full address as a string, so there's no easy way to break apart each individual component. It might be possible to do this with custom code, but that falls outside the scope of the support we provide here in the forums. If you'd like, you can submit a feature request describing what you would like to achieve, and our developers will evaluate it.

#711330

Hi Christian,

I feared that might be the answer. Yes, if you could add this as a feature request it would be appreciated. I would think this would be a universally beneficial feature in that users could build their WordPress sites to use the address field and be able to pull all geographic information just from that one entry. Thanks for the consideration!

- Aaron

#711792

Okay in the meantime another ticket here on the forum provides an example of one way you could use custom code to accomplish this in wp-admin:
https://toolset.com/forums/topic/separating-content-from-the-address-field/