Home › Forums › General Issues › saving different value than $_POST['acf']['field_xxx'] › Reply To: saving different value than $_POST['acf']['field_xxx']
From your code above
add_action('acf/save_post', 's4f_save_post_step_content', 20);
At priority 20 ACF is done. ACF runs at priority 10. This means that anything you do after will not be overwritten by ACF.
$_POST['acf']['field_6052632c663f5'] = $new_calc_total_collected;
This will have no effect whatsoever. As I said above. ACF has finished looking at these values on priority 10 so changing these values will not effect what ACF has already done with them. You are changing them at a point where the values no longer matter. Processing of this array has already been completed.
if you add an action with a priority < 10 like this
add_action('acf/save_post', 's4f_save_post_step_content', 1);
This will happen before ACF looks at what is located in $_POST['acf']
. Making changes to this array at this point will cause ACF to save the changes you make.
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.