Home › Forums › General Issues › updat_field not working for postobject\'value › Reply To: updat_field not working for postobject\'value
Hi @littledevil
What field type is ‘genrelist’?
If it is a post_object or relationship field, you can’t save “MYSTERY” as the value, you instead need to save a numeric value of the post’s ID.
If the field type is a text based field, your code should work.
If the field ‘genrelist’ is a new field and has not yet been saved on the fields, please read over the docs below to understand why you need to use the field_key instead of the field name
http://www.advancedcustomfields.com/resources/update_field/
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.