Skip Navigation

[Resolved] Repeater field programmatically add data with php

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1242636
Screen Shot 2019-05-11 at 11.01.22 PM.png

Tell us what you are trying to do?

I am trying to bulk import the JSON files with wp all import pro but it doesn't work with repeater fields. I need to know how can I add data in the repeater fields with PHP manually.

I have custom post type Communities and sub-communities is a repeater field. I didn't find any script on your forum for adding the data manually.

#1242817

Hello,

I assume we are talking about a repeatable field groups.

If it is, Toolset repeatable field groups are based on one-to-many post type relationship, each item of repeatable field group is also a post, so you can follow below document to import the items of repeatable field group and their post type relationship.
https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/how-to-import-data-from-a-csv-file-using-the-wp-all-import-toolset-types-add-on-plugin/post-relationships/#example-2-one-to-many-relationships

Notice: the relationship slug of repeatable field group is same as repeatable field group slug, you can get relationship slug value by this:
Edit the repeatable field group, find the value in option "Group slug".