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 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!
We are currently experiencing an issue with our hosting and our site is down. 😅— Advanced Custom Fields (@wp_acf) September 21, 2021
Apologies for the inconvenience, we'll keep you posted! ^IP
© 2021 Advanced Custom Fields. Subscribe