Home › Forums › ACF PRO › FR: acf_form return to permalink › Reply To: FR: acf_form return to permalink
I updated the code from the first poster. You can’t check for is_admin, because it returns true (Ajax call is made to admin). See Documentation
https://codex.wordpress.org/Function_Reference/is_admin
//Custom redirected after creating a post
function custom_redirect_function_name($post_id) {
$redirect = get_the_permalink($post_id);
wp_redirect($redirect);
exit;
}
add_action('acf/save_post', 'custom_redirect_function_name', 20);
$redirect can be anything you want in my case it is as follow’s
$redirect="/thank-you/?listing_id=$post_id"
I wanted an url like this to process some further actions based on user choice (option to upgrade to different levels)
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.