Home › Forums › ACF PRO › Taxonomy Terms › Reply To: Taxonomy Terms
I guess I’m a newbie and didn’t realize that in a while loop you can run a get_row()
to get the value of each loop.
I found that when set to Taxonomy Terms and despite setting the “Return Value” to “Term object” get_row()
only returns the term id. ( I guess I should change this back to ‘Term Id’ in case ACF fixes this bug in the future.)
So I have to also run get_term($termid)
Final result:
$terms = [];
while ( have_rows( 'resources_carousel_topic_filter_list' ) ) : the_row();
$terms[] = get_term(get_row());
endwhile;
echo "<pre>\n";
var_dump( $terms );
echo "</pre>\n";
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.