Home › Forums › ACF PRO › Comparing two select fields › Reply To: Comparing two select fields
Figured it out. The publish-hook is to early for ACF, so none of the newly published fields are ready yet. I changed it up to this:
add_action( 'save_post', 'save_jobb', 100, 3 );
..also cranking up the priority to 100, to make sure that all other save jobs are done first.
Furthermore I added a check for post type early in the new function, since the new one takes on all posting in general:
$post_type = get_post_type($post_id);
if ( "jobb" != $post_type ) return;
Lastly, to prevent emails from being sent every time I edit a post belonging to a customer, I also added a small, new ACF field named mailsendt
– to just hold the value 0 or 1 depending on whether a mail already has been sent or not.
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’re working hard on Advanced Custom Fields PRO 6.0, and Beta 1 is now available 🚀
— Advanced Custom Fields (@wp_acf) August 12, 2022
Featuring improved performance for Repeater fields with large datasets, and a new generation of ACF Blocks.
Let’s take a look 🧵https://t.co/Befre3kFAo
© 2022 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.