Hi!
I had a simple field findings_description
After a while I decided to wrap that field into a repeater called examinations
.
To migrate all existing fields to the new structure, I wrote two SQL queries:
UPDATE
wp_postmetaSET
meta_key= '_examinations_0_findings_description' WHERE
meta_key= '_findings_description'
and
UPDATE
wp_postmetaSET
meta_key= 'examinations_0_findings_description' WHERE
meta_key= 'findings_description'
To my surprise, this does not work. The field in repeater stays empty even though the db entry is set.
What am I missing here?
You need to set the repeater field to have one row. The meta key examinations
needs to hold the number of rows in the repeater and _examinations
needs to hole the field key of the field. These 2 rows would need to be added for every post where the repeater appears.