I’ve simple used a workaround related to your little function.
The problems with repeater and flexible coming with functions ‘have_rows()’ and ‘the_row()’. It’s like using the loop, outside the loop.
<?php
// Set language to default
add_filter('acf/settings/current_language', 'cl_acf_set_language', 100);
// check if the repeater field has rows of data
if( have_rows('repeater_field_name') ):
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
the_sub_field('sub_field_name');
endwhile;
else :
// no rows found
endif;
// Set language to current
remove_filter('acf/settings/current_language', 'cl_acf_set_language', 100);
?>
I see right now a better solution would be to use repeater/flexible content data as an array. It should work that way, i guess.
Thanks indrek_k!
I tried to use your wrapper function only but got some problems with repeater data.
Praise and honor to you AC. Thanks for the code!
Can confirm, i have the same behavior.
I hope it is okay to hook into this discussion.
I experience the same issue. Hardcoded Fields won’t give me the option page values from sub-sites after the switch_to_blog(), but ui-created fields work great.
I tried to debug it. The created query is alright but it gives ACF no data back.
SELECT option_value
FROM sw_4_options
WHERE option_name = ‘options_standort_color_main’
LIMIT 1
I also agree. Another great option would be a metabox title when you set the metabox-style to “Standard (WP Style).
I’ve found out that turning out the WPML Setting (WPML->Languages) “Adjust IDs for multilingual functionality” fixes the problem.
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 use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.