Problem: The customer wanted to get the Post ID of the new entry after a Toolset Form submission, run custom PHP, and pass the ID to a report page on redirect.
Solution: Use the "cred_save_data_form_{form-slug}" hook, which receives the new post ID as its first parameter, to run code such as update_post_meta(). Use the "cred_success_redirect_form_{form-slug}" filter with add_query_arg() to append the ID to the redirect URL, then read it on the report page with [wpv-search-term param="report_id"] or $_GET.
Relevant Documentation: 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.
Ce sujet contient 2 réponses, a 1 voix.
Dernière mise à jour par - Il y a 1 week, 5 days.
Assisté par: Christopher Amirian.