K
K
kryamk2021-06-09 13:59:54
WordPress
kryamk, 2021-06-09 13:59:54

How to get records using meta_query between on numeric acf fields (can be fractional)?

A range is passed from the js file (min and max values ​​collected from the square field of the product). The problem is that if square-min is fractional, then this product is not displayed (exact field matching does not work). Changed type to decimal - output only the last one (with square-max value). Removed type - nothing is displayed

array(
  'key' => 'square',
  'value' => array($_GET['square-min'], $_GET['square-max']),
  'type'    => 'numeric',
  'compare' => 'BETWEEN'
);


How to make BETWEEN work with integers and fractions at the same time?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question