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.
A) //update height field
Update that field with PHP in my_action (tried it, it didn’t work. maybe I’m not targeting the field properly).
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?
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!