[Resolved] Combine Custom Fields into Single Variable?
This support ticket is created 11 years, 3 months ago. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Hi,
I've got a series of custom fields that comprise an address (i.e. street, city, state, zip). In the context of a Content Template, is it possible to combine these fields into a single variable?
I'm using the 5Sec Google Maps plugin (hidden link) that will accept a value from a single custom field, but since my address involves multiple custom fields, I was wondering what a workaround might be.
Hi Caridad,
Thanks for the quick reply and help! In the example you give would I need to add a custom field called 'full-address' in my address custom field group?
Okay, I see. In your example, does wpcf-address refer to a specific custom field or to a group of fields? The function is working, but it's coming back empty. Thinking I need to replace wpcf-address, but just wasn't 100% what that was referencing.
Sorry, I didnt explain that part too much. You have to start building up the address in the $address variable. Lets say you have 4 custom fields defined in types and their slugs are street, city, zip, state. The real names have a wpcf- prefix, the full example would be like this: