Support

Account

Home Forums Backend Issues (wp-admin) Use ACF field selection to update another ACF field Reply To: Use ACF field selection to update another ACF field

  • D’oh! I realise now the add_action wasn’t supposed to go in the admin-ajax file.

    I’ve added it to my functions file and I’ve now got the user ID of selected user sending there, where I get the height of that user. I also managed to send that response back to the jquery and into an alert.

    What I need to do now is get another 2 variables in the my_action (easy enough), and update 3 ACF fields (height) (weight) (bodyfat) on the front end.

    Should I
    A) //update height field
    update_field(‘field_5c3daeb8608ae’, $heightno);

    Update that field with PHP in my_action (tried it, it didn’t work. maybe I’m not targeting the field properly).

    or

    B) Send the 3 values back to the jQuery and try and do it that way. So far I’ve only managed to send ‘response’ back, which is a single value. Can I send multiple values?

    Thanks