I have the following issue:
I run the following query:
$interventii = get_posts( array(
'post_status' => 'publish',
'post_type' => 'interventii',
'meta_query' => array(
array(
'key' => 'interventie_data_interventie',
'value' => array($azi, $aziAltFormat),
'compare' => 'IN'
),
),
'posts_per_page' => 9999999,
'order' => 'DESC',
'orderby' => 'date',
) );
On the same page I also have a select input where I choose a new date ($azi variable) which triggers an ajax call with a function that runs the get_posts() with the new $azi variable. The issue is that if the initial $interventii is empty and returns no posts for the default date ($azi) then even if I choose a new date and I know for sure that it has posts, it will return empty. If there are posts on the default date, then the functions and the ajax call runs without any issues even if I choose another date.
The interesting thing is that if the initial query has posts, the ajax works just fine. If the initial query returns no posts, then the ajax will return no posts as well even if I know for sure that based on the selected date, we have posts in the db
What could be the problem here?
Thanks!