Problem:
How can we update automatically the title or other content of a post related to the one we are currently editing in a Form so that the data of the currently edited Form is updated to the related Post(s), automatically, when we submit the Form?
Solution:
This is possible with Toolset Forms' API.
When working with Forms that both set a relationship to other posts, and the data of these edited posts should be used to then update the content of the related post, you should use the cred_submit_complete hook of Toolset Forms API.
In the hooks function, you should determine the related posts using the Toolset Relationships API.
Then, with the WordPress core method wp_update_post() you can update the related posts with content from the currently edited post.
A good example can be found here:
https://toolset.com/forums/topic/auto-populate-parent-title-and-date-as-child-content-title/#post-1282743
Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
https://codex.wordpress.org/Function_Reference/wp_update_post
https://toolset.com/documentation/programmer-reference/cred-api/
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 8 replies, has 2 voices.
Last updated by 5 years, 5 months ago.
Assisted by: Beda.