ACF-Tools
ACF-Tools copied to clipboard
Taxonomy field
When returning a taxonomy field with Term-ID as return type, the generated code is broken.
`<?php $persons_categories = get_sub_field( 'persons_categories' );
<?php $get_terms_args = array(
'taxonomy' => 'category',
'hide_empty' => 0,
'include' => $taxonomy_id,
); ?>
<?php $terms = get_terms( $get_terms_args ); ?>
<?php if ( $terms ) : ?>
<?php foreach ( $terms as $term ) : ?>
<a href="<?php echo esc_url( get_term_link( $term ) ); ?>"><?php echo esc_html( $term->name ); ?></a>
<?php endforeach; ?>
<?php endif; ?>
`