Problem:
How to display repeatable field groups using PHP?
Solution:
Each group of repeatable fields is stored in a child post, so if a post has 3 groups of repeatable fields then that post will be connected to 3 child posts which each store the field values.
You use the relationships API, specifically the function toolset_get_related_posts to get the child posts, and you then iterate over those to get and output the field values as required.
Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts
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 |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 3 replies, has 2 voices.
Last updated by 5 years, 2 months ago.
Assisted by: Nigel.