Skip Navigation

[Resolved] Pull Hidden Field Values From DB

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

Assisted by: Luo Yang.

Author
Posts
#1235894

I'm not a developer...may not explain this perfectly. We're setting up a form for scheduling services that will create a custom post when submitted. We have hidden fields, like ClientID and DivisionID (latter is the division name within the client's company) that we would like to pull from "somewhere" and pass along in hidden fields when the form is submitted.

I was able to do this with CPT-UI and ACF in the past...how do I do so with Toolset?

#1235942

Hello,

I suggest you try with action hook "cred_save_data". For example,
1) when user submit the your post form, use action hook "cred_save_data" to trigger a custom PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

2) In this PHP function, get the field values: hidden fields, like ClientID and DivisionID:
https://codex.wordpress.org/Function_Reference/get_post_meta

And save them into database:
https://developer.wordpress.org/reference/functions/update_post_meta/