Home › Forums › ACF PRO › Redirect Form to variable External URL › Reply To: Redirect Form to variable External URL
You are doing this on an acf/save_post hook. That means that this happens after the post is created and this will always be true. So, none of your code is being run.
if($post_id != 'new') {
return $post_id;
}
Completely missed that this was with acf_form() and that part of your code.
It does not even matter that this does not match the post_id setting for acf_form().
You will need to find another way to test, maybe a combination of is_admin() and get_post_type($post_id)
if (is_admin() || get_post_type($post_id) != 'post_type_listings') {
return;
}
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.