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
413 stars 56 forks source link

ACF Options repeater field #149

Closed hallowichig0 closed 1 year ago

hallowichig0 commented 1 year ago

Hi, when I tried to used the options page and add a basic example of repeater. When I tried to var_dump or dd the repeater field, Example dd(get_field('items', 'option')) it shows a number instead of array.

orlockz commented 1 year ago

Hi!

Try with

get_field('items', 'option')

Note the '' around 'option'. Also, I think 'options' works as well.

Log1x commented 1 year ago

I'm using multiple repeaters on an Options page with my current project without any issues.

get_field('example', 'options')

is returning an array of items.

Where are you using get_field()? Does it work when inside of a hook like init or after_setup_theme?

hallowichig0 commented 1 year ago

Hi @Log1x , init solved the problem. Thank you

Log1x commented 1 year ago

No problem!