Support

Account

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..