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!