Support

Account

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');