acf-builder icon indicating copy to clipboard operation
acf-builder copied to clipboard

I could not get setWrapper to work.

Open MJH1000 opened this issue 10 months ago • 0 comments

Hi,

does anyone know how to use setWrapper. I tried this and I could not get it to work.

$banner = new StoutLogic\AcfBuilder\FieldsBuilder('banner');
$banner
    ->addText('title')
    ->addWysiwyg('content')
        ->setWrapper(['class' => 'foo', 'id' => 'bar', 'width' => '50'])
    ->addImage('background_image')
    ->setLocation('post_type', '==', 'page')
    ->or('post_type', '==', 'post');

add_action('acf/init', function () use ($banner) {
    acf_add_local_field_group($banner->build());
});

MJH1000 avatar Jun 11 '25 11:06 MJH1000