Support

Account

Forum Replies Created

  • 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)

Viewing 1 post (of 1 total)