Support

Account

Home Forums Backend Issues (wp-admin) How to create calculated fields Reply To: How to create calculated fields

  • Hi there,

    Your code seems good.
    As you said, if you’re calculating your “total_return” into first snippet only, your calculation is working.

    Why don’t you update all your field in a single snippet (your first one) ?

    If you really need to use different snippets for each field, maybe you could add different priorities to your actions.
    See documentation: https://www.advancedcustomfields.com/resources/acf-save_post/

    So keep your first snippet without modifications (default priority is 10).
    And try adding a priority of 15 for your second snippet :
    add_action('save/post' 'my_acf_update_total_return', 15);

    Let me know if it helps,

    RemSEO