Error with custom query
-
Hi there. I’m doing a custom query in one of my templates and there is a little problem. These are the custom args:
array('posts_per_page' => 10, 'offset' => 0, 'meta_query' => array(array('key' => 'score', 'value' => 0, 'type' => 'NUMERIC', 'compare' => '>')), 'order_by' => 'meta_value_num', 'order' => 'DESC');
this doesn’t work but if I use
'value' => 1, 'compare' => '>='
it does. It seems to me that the error is inwp-includes/meta.php
, core function_parse_meta_query
. The function check the arguments callingempty()
but ‘0’ is considered empty in PHP and so my query isn’t parsed correctly.I think that it’s a bug, am I missing something?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Error with custom query’ is closed to new replies.