Home › Forums › Add-ons › Repeater Field › Repeater field shortcode? › Reply To: Repeater field shortcode?
I updated the code to run as I mentioned above. You can find it here:
https://gist.github.com/FranciscoG/c393d9bc6e0a89cd79d1fd531eccf627
I also forgot to mention that it will parse shortcodes within the repeater rows
[acf_repeater field="my-row" sub_fields="full-name,phone-num"]
name: %full-name%
[another_shortcode]phone: %phone-num%[/another_shortcode]
[/acf_repeater]
Caveat: You can not do nested repeater rows. However you need to you can just duplicate the add_shortcode
and add more shortcode repeaters shortcodes and it will work. There’s probably a much better way to handle unrestricted amount of sub-repeaters but that’s a lot more work and testing for another day
add_shortcode("acf_repeater", "my_acf_repeater");
add_shortcode("acf_sub_repeater", "my_acf_repeater");
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.