Home › Forums › Feature Requests › Query by dropdown field label › Reply To: Query by dropdown field label
this is a great workaround.
So i’d first do the WP_Query without limiting the results by comparing the user input and after the query i’d loop the results once more to filter the results via php.
I need the field’s label for the WP_Query, not after the query.
If i had two values to compare like:
'meta_query' => array( array( 'key' => 'kk-cups-min', 'value' => $userInput, 'compare' => '<=', 'type' => 'NUMERIC' ), array( 'key' => 'kk-cups-max', 'value' => $userInput, 'compare' => '>=', 'type' => 'NUMERIC' ) ... ),
i’d have do loop twice to filter the results via php.
I think this is a great solution so far.
(it would be much more easier if one could do it all in the WP_Query, but this workaround is just fine for me now)
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!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.