I am having a issue in ACF PRO 5.0.6. When trying to get all fields with:
I have setup a Flexible content element, which contains currently one layout named content_block.
The layout contains 7 fields but when requesting all layouts/fields with
get_fields($post_id) I only get 5.
Current result of one Flexible content element:
Array ( [acf_fc_layout] => content_block [classes] => [background_color] => [background_image] => [background_fixed] => [title] => )
Array ( [acf_fc_layout] => content_block [classes] => [background_color] => [background_image] => [background_fixed] => [title] => [content] => [test] => )
Tried recreating the fields and resaving multiple times with no success.
Did another small test
while ( has_sub_field('blocks') ) : print_r(get_sub_field('title')); print_r(get_sub_field('content')); endwhile;
Shows only the title.
Shows the content key in the array
[blocks_0_content] => Array (  => Bla bla bla ) [_blocks_0_content] => Array (  => field_53fc61e4d4240 )
Another thing I noticed that tabs still show up as an empty key:
[custom_fields] => Array ( [blocks] => Array (  => Array ( [acf_fc_layout] => content_block  => [title] => This is the title [content] => This is the content [fixed_bg] => 1 ) ) )
Not sure if this has anything to do with it, since we are using multiple tabs… wp_cache_get sets the found to true, while the result is empty (api-field.php line 454)
I also have this problem. The last few items always disappear. If I reorder, the new last items have disappeared.
Noticed that this happens for me when I use tabs in a Flexible Content field.
I have the same issue.
get_fields() does not return all fields. I tried to add new ones and see if they work and they don’t.
get_field(‘the_field’) is working though…
I just wonder why the get_fields() is bugged for this particular post. Because this get_fields() is used on a single_[post_type] and all other posts are working fine.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
10 years ago, a little plugin called Advanced Custom Fields popped onto the https://t.co/79Y5uWU7lY repository hoping to help a few like-minded developers.— Advanced Custom Fields (@wp_acf) May 31, 2021
Those “few” grew to 2M 📈🎉
Join us in celebrating 10 brilliant years with 10 tweets of brilliant features found in ACF! pic.twitter.com/oT1HPjdygF
© 2021 Advanced Custom Fields. Subscribe