Get result from meta_query() between two numbers

Multiple meta values can be compared with BETWEEN with an array value:

'meta_query' => array(
    array(
        'key'     => REALIA_PROPERTY_PREFIX .'attributes_area',
        'value'   => array( $first_val, $second_val ),
        'type'    => 'numeric',
        'compare' => 'BETWEEN',
    ), // inner array.
), // outer array.

You can see this in Developer Doc.

Leave a Comment