Home › Forums › Front-end Issues › Pass Values from ACF Form to Thank you page. › Reply To: Pass Values from ACF Form to Thank you page.
You only need to add it to the end of the link like this:
wp_redirect( 'http://localhost:8888/wordpress/thank-you/?thankid=' . $post_id ); exit;
And in the thank you page template, you can get the ID like this:
$new_post_id = $_GET["thankid"];
And then use it with the get_field() function like this:
$name = get_field('custom_field_name', $new_post_id );
echo $name;
Where “custom_field_name” is the name of the custom field.
I hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.