Home › Forums › Add-ons › Repeater Field › Nest existing repeater inside new repeater, retaining field values › Reply To: Nest existing repeater inside new repeater, retaining field values
That’s a tough one.Sub field values are saved to wp_postmeta etc. in this way: repeater_field_name_0_sub_field_name with 0 ticking upwards with each row.
With an repeater inside another repeater I think it’ll be:
Since you now initially want to put your repeater in another repeater I’m assuming the whole current repeater should go as the first row (I.E. 0).
You’d probably have to do some clever SQL queries to change the values of each repeater_field_name_0_sub_field_name into repeater_field_name_0_sub_repeater_field_name_0_sub_field_name
but you’ll also first have to make sure atleast 1 row has been previously created in the root repeater. If you check the DB you’ll see that the repeater fields only contain a count (starting at 1) of how many rows they contain so just running an SQL for the above will not cause the values to show up.
Hope I got you started! It’s not an easy topic to tackle 🙂
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.