Home › Forums › General Issues › Save/post data to Acf field default values? › Reply To: Save/post data to Acf field default values?
Hi @jwight1234
If you look down at the create_field
function, you shoudl see an input that has a name attribute of $field['name']
.
This is how ACF can POST the data to the correct name.
If you are saving 1 value, then just get your JS to put the value into this input.
If you are saving multiple values, then I will need to explain how to post an array in a later comment.
Now, after you have saved a value, you can find the value (again in the create_field function) with $field['value']
. ACF will already load the value for you and place it here!
Easy
Thanks
E
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.