Home › Forums › Add-ons › Flexible Content Field › Convert Repeater to Flexible field — after content's been added › Reply To: Convert Repeater to Flexible field — after content's been added
Thanks for the question. You are quite right, the data is still intact in your DB and it is possible to change the field type from repeater to flexible content.
Both field types save the sub field data in the same way, the only difference is the way they save their own reference data. By this, I mean how many rows are saved.
The repeater field will simply save a number like so: 3
This means that there are 3 rows of data available, and the repeater field will load them in.
The flexible content field does not save just a number, instead it save’s an array of ‘layout’ names like so:
array('content', 'images', 'download')
This means that there are 3 rows of data available, and the flexible content can load the appropriate ‘layout’ and the data.
So, all you need to do is edit your DB (wp_postmeta table) where the meta_key is your repeater field name. The value will be a number, and you will need to change it to a SERIALIZED array containing the correct number of layout names.
Hope that helps.
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!
© 2022 Advanced Custom Fields.