Support

Account

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.