Home › Forums › General Issues › Multi Select – Get all choices for Query Args › Reply To: Multi Select – Get all choices for Query Args
Reading https://www.advancedcustomfields.com/resources/taxonomy/#template-usage via one of the threads you helped with @hube2 I realized I can of course loop through the array:
<?php
$terms = get_field('events_category');
if( $terms ): ?>
<?php foreach( $terms as $term ): ?>
<?php echo esc_html( $term->slug ); ?>
<?php endforeach; ?>
<?php endif; ?>
and then I do get local virtual
.Just not with commas to use in wp_query
terms
yet. Will need some formatting to be used as variable in
'tax_query' => [
'taxonomy' => 'event_category',
'include_children' => false,
'field' => 'name',
'terms' => $event_cat_slugs,
That and I wonder if there is a quicker way to get these for my variable. A foreach loop seems a bit much..
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.