I need to import URLs into a custom field (using WP All Import) called "delayed_images".
In Types I've set this field to accept multiple instances. I'm just wondering how/if this will work if I import various data points from the XML file into this one field.
So for example, in the import I add these elements to the delayed_images field (also see screenshot attached):
{Photos[1]/Photo[2]/MediaURL[1]}
{Photos[1]/Photo[3]/MediaURL[1]}
{Photos[1]/Photo[4]/MediaURL[1]}
{Photos[1]/Photo[5]/MediaURL[1]}
{Photos[1]/Photo[6]/MediaURL[1]}
1. Can you confirm that each of the URLs that's imported into the field will be added as a separate "instance"?
2. Do I need to add a separator between each url that's added (e.g. a comma)?
Thanks
Hi, as far as I'm aware it's not a simple process with WP All Import to import fields that support multiple instances. You can add a comma separator and then use some custom code to split those apart into multiple field instances, as shown in this other post: https://toolset.com/forums/topic/importing-data-as-arrays-to-custom-fields-repeating-text-area/
Christian, how is information stored in a Types custom field with multiple instances?
Based on WP All Import's documentation, I can use the Variable Repeater Mode (XML). The documenation is for Advance Custom Fields, but I'm hoping it would be a similar process for Toolset Types.
hidden link
Is the data for multiple instances saved within one database field, and if so, how does it look (i.e. comma separated)?
Data for multiple instances is saved in multiple postmeta entries. It is not saved in one field with some separator. So if the field slug is "my-slug" and a post has multiple instances of the my-slug field, there will be multiple entries in postmeta of my-slug associated with the same post ID. Here is a screenshot of postmeta for a repeating field.