Home › Forums › Backend Issues (wp-admin) › Add custom field value to multiple posts at once › Reply To: Add custom field value to multiple posts at once
Hi there, thanks for your response!
To clarify, now I have set up an Options Page with a repeater field called “Sales”. This repeater contains three fields:
“Sale type” – Select – Fixed $ amount / Fixed % discount
“Discount” – Number – Amount of discount
“Devices” – Post Object – Selects applicable posts
Then, for the main device post type, those three fields will be duplicated. Now what I need is a way to pass those values to the fields in the posts chosen. I understand I can use update_field() – I’m thinking I can write a loop that collects the post IDs from the post object field and then uses update_field() to apply the values selected to those posts.
That seems to make sense- but then I’m not sure how I would even call the update_field() action or where that would live. I am far from an expert in WordPress plugin coding, so any help is much appreciated!
Cheers
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.