Collapsible Repeater Rows

Description

Renders configured Gravity Forms Repeater rows collapsed with live previews of selected subfields. Each row includes an accessible Edit/Done Editing toggle, multi-row Repeaters provide a Collapse all action, previews update as values change, and rows added or removed dynamically are supported.

Usage Notes

  • Requires Gravity Forms 3.2.0 or later for the first-class Repeater field and its add/delete JavaScript events.
  • Configure $gfrc_preview_fields by form ID, Repeater field ID, and the ordered subfield IDs to preview. The gravityformslabs_repeater_preview_fields filter can alter the configuration before it is normalized.
  • The behavior applies only to configured frontend Repeaters. Form editor and entry detail screens remain unchanged.
  • Preview values are reduced to plain text. Choice fields display their labels; empty values display an (empty) indicator.
  • The markup injection depends on the current Gravity Forms Repeater HTML structure and modern Theme Framework classes.

Code

Snippet Documentation

Frequently Asked Questions

Adding a snippet is easy-peasy.

How do I add a snippet to my WordPress site?

Click the Copy Code button to copy the snippet to your clipboard. Then paste it into the appropriate file in your WordPress installation — typically your theme’s functions.php file or a custom plugin file. Alternatively, you can use a code-snippets plugin to add the code without editing theme files directly.

Where should I place PHP snippets?

The recommended approach is to create a site-specific plugin or use a code-snippets manager plugin. Avoid adding code directly to your theme’s functions.php — those changes are lost when the theme updates. If you must use a theme file, use a child theme’s functions.php instead.

Where should I place JavaScript or CSS snippets?

JavaScript and CSS snippets should be enqueued properly using wp_enqueue_script() or wp_enqueue_style() within a PHP file (such as your custom plugin or child theme’s functions.php). Avoid pasting scripts directly into template files or the Customizer’s “Additional CSS” for anything non-trivial.

Do I need to log in to copy a snippet?

Yes. Snippet code is only visible to logged-in users. Create a free account or log in to view and copy the full code.

What does the “Requires” field mean?

Each snippet lists its dependencies — the minimum versions of WordPress, PHP, and any Gravity Forms add-ons needed for the snippet to work. Make sure your environment meets these requirements before using the code.

Will snippets break my site if I update Gravity Forms?

Snippets rely on Gravity Forms hooks and APIs that may change between major versions. Always check the snippet’s version compatibility before updating. We recommend testing on a staging site first. If a snippet stops working after an update, check back here — we update snippets when breaking changes occur.

Can I modify a snippet to fit my needs?

Absolutely. Snippets are starting points. You’re free to adapt them to your specific use case. If your changes might benefit others, consider contributing back via the linked GitHub repository.