Home › Forums › Feature Requests › Query by dropdown field label › Reply To: Query by dropdown field label
Hi James,
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!
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.