Home › Forums › General Issues › Multi Select – Get all choices for Query Args › Reply To: Multi Select – Get all choices for Query Args
Saw something funny happening to the quotes so used decimal code for quotes:
// Variables $number_of_events = get_field( 'number_of_events' ); // print_r($number_of_events); $terms = get_field('events_category'); // print_r($terms); // $term_slugs = $terms()->slug; $term_slugs =''; foreach ( $terms as $term ): $term_slugs .= "＇" . esc_html( $term->slug ) . "＇" . ','; endforeach; $term_slugs = substr($term_slugs, 0, -1); //Removes very last comma. // print_r($term_slugs); // local,virtual, $args = array( 'post_type' => 'event', 'posts_per_page' => $number_of_events, // 'event_category' => $term_slugs 'tax_query' => [ 'taxonomy' => 'event_category', 'include_children' => false, 'field' => 'name', // 'terms' => array_values($term_slugs), ], );
still no filtering on event category..
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’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.