Home › Forums › General Issues › Flexible content Inception › Reply To: Flexible content Inception
I’ve rewrote my function tax_get_field_data another way:
function taz_get_field_data($shortcodeID){
if (class_exists('acf')){
if (have_rows('taz_features')){
$counter = 0;
while (have_rows('taz_features')){
the_row();
if ($counter === $shortcodeID){
return get_row(true);
}
$counter++;
}
}
} else {
error_log("taz_get_field_data(): ACF Plugin is not available.");
return null;
}
}
Since the_row is not formatted, I was hoping for the best and did my formatting only on the wanted row with get_row(true).
Sadly, even if I don’t have an infinite loop anymore, the result is messed up.
get_row(), as get_field() are parsing the included shortcodes [taz_features] shortcode! Why??? Why “format_value” cares of “do_shortcode”.
I’m missing the ability to format the array, to get [content] key rather than [field_583b166074db8_field_57e024d987a79], but I don’t need the actual value to be parsed. This, I’ll take care later on my code.
Any idea?
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.