Repository navigation
Pods Repeater Field — repeatable field groups as a field type (alpha) #7652
phoenixseo
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Pods can repeat a single value. It cannot repeat a group of fields. I built
the missing piece as a standalone field type, and I am posting it here because
this is the shape of answer the "Repeatable Field Groups" threads have been
missing.
GitHub: https://github.com/phoenixseo/pods-repeater
Release: https://github.com/phoenixseo/pods-repeater/releases/tag/v0.3.0-alpha
What it does
Define a set of sub-fields once, then add, remove and reorder rows of them in the
post editor. Rows are stored as one JSON string in post meta (or the Pods table
column for table-based Pods) — no extra tables, no custom schema, no serialized
PHP.
Read it back with the plain Pods API:
or with an ACF-compatible loop, so a theme written against ACF does not have to
be touched (
pods_repeater_register_acf_aliasescan turn the aliases off):What it looks like
Two repeaters on one Pod — a track list and the pressings of a record, both
rendered in a template:
Status, honestly
0.3.0-alpha. Test site only. 127 tests / 2455 assertions, green on PHP 7.4
and 8.3 against WP 6.8.2 and Pods 3.3.9.1 (GitHub Actions runs both), admin UI
exercised in a real browser. One person, no support promise, no release
schedule.
Known limitations, in the README rather than in a support thread later
file/avatar/oembedsub-fields. Those render through Pods'React field editor, which does not initialise inside a cloned row — from row
two on the picker would be dead. Put such a field on the Pod itself.
values on write.
import/export route.
stored value.
Why I am posting this and not a PR
The open question is the build form: a self-contained field type (what I
built — own
input(),pre_save(),value(), registered throughPodsForm::register_field_type(), no core file touched) or an extension of theexisting
repeatablemechanism (one row implementation instead of two in theecosystem). I have an opinion, not the authority. Comment in
#7238 or here.
If the answer is "not into core" — fine. Then this is a plugin that fills the
gap today, and the thread gets a working implementation to point at.
All reactions