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
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.