Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
419 stars 57 forks source link

How to add Multiple Field Groups at once #182

Closed JUVOJustin closed 7 months ago

JUVOJustin commented 10 months ago

I am looking for a way to not only define one FieldBuilder/FieldGroup at once but multiple. Since I am dynamically generating the fields i would like add them based of some terms to specific Field Groups.

My plan was to get all the terms to iterate over them, create a FieldBuilder instance for each, and then add the fields based on some logic to one of the instances. However, the fields() function of the Field Class is expected to return only one FieldBuilder instance.

Is it possible to dynamically add multiple fieldBuilder instances?

Log1x commented 7 months ago

You can now return an array of Builders.