Home Forums Add-ons Repeater Field Programatically create repeater field for a post


Programatically create repeater field for a post

    • dror

    • November 26, 2013 at 5:29 am

    I need to add data to a repeater field in a custom post type programatically. What I did is add all the needed meta fields, BUT it does not create the required reference meta fields, so I cannot use the API to get the data in the front-end. Obviously, It’ll add the references if I just save the post from the back end, but that’s not acceptable for my application. How can I add all the references correctly (So I wouldn’t have to manually click save in the admin)?

    • Elliot

    • November 26, 2013 at 11:15 am

    Hi @dror

    Please use the update_field function (docs available) to save the repeater field value.

    The value saved should be a multi-dimensional array containing rows of data, where each row is an array containing the field_name => field_value relatinoship.

    Does that help?


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.