Skip Navigation

[Resolved] FIeld to concatenate other fields

This support ticket is created 3 years, 5 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#2163317

Hello,

I have 2 fields and I want the concatenate these 2 fields in 1 field in Toolset
How can I do that?

Thanks!

#2163375

Hello,

I assume we are talking about these:
1) Three custom fields:
- Field A
- Field B
- Field C

2) You are going to setup "Field C" value using other two fields values "Field A" and "Field B"

If it is, there isn't such kind of built-in feature within Toolset plugins, you might consider custom codes, for example
1) After user fill values into fields "Field A" and "Field B", and save the post, you can use WordPress action hook "save_post" to trigger a PHP function:
https://developer.wordpress.org/reference/hooks/save_post/

2) In this PHP function, get the fields values "Field A" and "Field B"
https://developer.wordpress.org/reference/functions/get_post_meta/
Use them to setup the "Field C" value:
https://developer.wordpress.org/reference/functions/update_post_meta/