Problem:
We want to populate a Toolset Custom Field with data from the post (author, or else) when a post is edited or created.
How can we do that?
Solution:
With a save_post or cred_save_data action of Toolset and WordPress hooking custom PHP code the event of saving a post, be it in the backend or front end.
Inside these hooks you can use native WordPress method update_post_meta for example, to update the Toolset Custom Fields.
It is important here to know that the meta key of a Toolset Field always will start with wpcf-
Relevant Documentation:
https://developer.wordpress.org/reference/functions/wp_update_post/
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
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 |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
This topic contains 4 replies, has 2 voices.
Last updated by 4 years, 8 months ago.
Assisted by: Beda.