Home Forums Add-ons Repeater Field Duplicate Repeater field content on the backend


Duplicate Repeater field content on the backend

  • How do I duplicate content on the backend of the repeater field when I add a row ?

  • ACF does not have a way to duplicate a row, you have to create a new row and then copy/paste the content to duplicate.

    • rdm

    • February 22, 2019 at 6:43 am

    If you really wanted to implement this, I imagine you could implement the functionality in javascript.

    For example, use the admin_footer action (and use get_current_screen() to check that you’re on the right screen), to emit a script tag that hooks into the html emitted by the repeater support code.

    You would have to figure out how you want to identify the copy from and copy to locations (if you made it always be the last two items, that would simplify your work for your initial draft).

    Anyways, not a completely trivial task (but much easier if you limit yourself to just the fields you’re actually using than if you try and build a general structure that anticipates future acf changes).

    If you go this route, you’ll also need to leave some notes on how to test a new acf update to make sure your mechanism still works with it.

    Manually copying the contents might be a bit more work than using an automated mechanism, but unless this gets used a lot, it might actually wind up being a lot less work in the larger scheme of things.

  • thanks guys for your responses. I will stick with the manual copying for now.

Viewing 4 posts - 1 through 4 (of 4 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.