ACF-Tools icon indicating copy to clipboard operation
ACF-Tools copied to clipboard

Taxonomy field

Open RostiMelk opened this issue 4 years ago • 0 comments

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; ?>
`

RostiMelk avatar Aug 25 '20 10:08 RostiMelk