Home › Forums › General Issues › calculation not updating › Reply To: calculation not updating
I would try adding the post ID reference to the get_field calls in your function, like:
function perf_pln2($post_id)
{
$total = (get_field('zip',$post_id)+get_field('kraken',$post_id))/(get_field('_price',$post_id)+0.01);
$value = $total;
$field_name = "perf";
update_field($field_name,$value,$post_id);
}
add_action('save_post','perf_pln2');
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.