Home Forums Add-ons Repeater Field Convert Field to Repeater without Loosing Existing Data Reply To: Convert Field to Repeater without Loosing Existing Data

  • I think you’d have to do in manually by creating a script to do the work.

    You field, not as a repeater requires two postmeta entries

    • your_field_name => your field value
    • _your_field_name => ACF field id: this field name is the same as your field name prefixed with an underscore and contains a reference to the ACF field id generated when creating the field.

    When you have a repeater this changes to

    • repeater_field => count of rows
    • _repeater_field => ACF field id of the repeater
    • repeater_field_X_sub_field => each row subfield value, the X is the index of the row starting at 0
    • _repeater_field_X_subfield => ACF field id of the sub-field

    My suggestion would be to leave it as it is and create a new field for your repeater. Tell the client that on new posts to ignore the old field and use the new one, and when updating an old post to move the old images to the new field. Then in the front end use values from both fields in the display.