Home › Forums › General Issues › differentiate between post types on acf/pre_save_post › Reply To: differentiate between post types on acf/pre_save_post
WOW, I had this exact issue a few weeks ago and could not for the life of me figure it out. I was certain it was my own code that was messing it up. However, since I was not able to get ‘post_type’ to work in the html_after_fields parameter I instead used the $_POST[‘post_id’] value and then did a get_post_type(‘$_POST[‘post_id’]) to determine the type within my various functions.
I think either way works just as well, but my way moves more control to the function rather than relying on the the acf_form array to pass an extra value.
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.