StoutLogic / acf-builder

An Advanced Custom Field Configuration Builder
GNU General Public License v2.0
794 stars 62 forks source link

ModifyField with Accordion/Tab #152

Open Androlax2 opened 2 years ago

Androlax2 commented 2 years ago

Hi,

I have made this structure with unit tests :

$builder = new FieldsBuilder('Banner');
        $builder
            ->addGroup('group')
            ->addTab('tab')
            ->addAccordion('accordion')
            ->addWysiwyg('content')
            ->addAccordion('accordion_endpoint');

        $builder
            ->modifyField('group->tab_tab->accordion_accordion', function ($builder) {
                $builder->addText('sub_title');
                return $builder;
            });

As you can see, we cannot do :

$builder
            ->modifyField('group->tab->accordion', ...)

We need to suffix tabs with _tab and accordions with _accordion.

Is this on purpose ? @stevep ? Otherwise, I can make a PR to fix that