Home › Forums › General Issues › Insert Relationship Fields Using update_field() › Reply To: Insert Relationship Fields Using update_field()
Hi @alfkonee
Sure, the update_field function can be used to update any postmeta value.
All you need to do is create an array containing the post ID’s you wish to save as the relationship value, and then use the update_field function to save that array ($value) to the post.
The docs will explain what parameters are needed for the function to work.
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.