Home › Forums › Backend Issues (wp-admin) › [Login WP] Connect single field to an external api › Reply To: [Login WP] Connect single field to an external api
After you insert the new user you need to get the value you want from the response and update the acf field.
You need to use the Field Key because the value will not already exist
$new_user_id = wp_insert_user($userdata);
// get value from response you want to set
update_field('field_XXXXXXXX', $value, 'user_'.$new_user_id);
https://www.advancedcustomfields.com/resources/update_field/
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.