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 reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U
— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 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.