Roots Discourse

How would you implement this?

I researched a lot about this topic - but I still haven’t found a working set.

A repeater/loop/add more/infinite field, which allows to add multiple items of arbitrary amount to a post (in admin backend).
Each of these items in repeater/loop list should contain a simple text field and a relationship/post selection field with which a post (ideally filtered by type) can be selected.
Finally it should be possible to pre-populate such a repeater/loop list programmatically (using PHP code, in a plugin) in a specific post type admin backend page.

It appears that WordPress plugins or frameworks/libraries only partially implement one of these needed features - but never everything - and loop items cannot be extended by other plugins, they are usually an internally used data structure.

Are there no free or opensource plugins or frameworks that offer this functionality?
What existing code can be build on to add this functionality by reusing as much as possible?


I’d build it on ACF Pro and utilize the above libraries, specifically ACF Builder.

Seriously, ACF is the only plugin/framework to bother with when it comes to anything field/repeater/options related. I’ve exhausted every “options framework” such as Redux (including $300+ of extensions which I now regret), Titan Framework, etc. and ACF is easily the best.

The only “downfall” I can think of is it may not be as pretty to look at out of the box as some of the options frameworks mentioned above, but with a little CSS loving and the utilization of tabs, it actually can look pretty great. :stuck_out_tongue:

1 Like

ACF is definitely the best. It’s prob the most important plugin I use!

Different scenario:

In Custom Post Type 1 a loop field is filled by the user, one field in loop item can be left empty.

In Custom Post Type 2 the user selects a Custom Post Type 1 from a (relationship) list and then the loop items with the empty field should be displayed as text input fields in Custom Post Type 2 admin page.

Edit:
A table with a text input in last column.
The content/rows of table is controlled by PHP code which uses a query for the data.