I am trying to do a meta_query, but not getting expected results. In this particular case, the key in question is "_EventHideFromUpcoming" (see below) with a value of "yes" (stored as a string). Also, if the value is not "yes", the key "_EventHideFromUpcoming" is not present at all.
I have the following query:
date_default_timezone_set('America/New_York'); $now = date('Y-m-d H:i:s'); $args = array( 'post_type' => 'tribe_events', 'posts_per_page' => '-1', 'orderby' => '_EventStartDate', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'AND', array( 'key' => '_EventEndDate', 'value' => $now, 'compare' => '>=', ), array( 'relation' => 'OR', array( 'key' => '_EventHideFromUpcoming', 'compare' => 'NOT EXISTS', ), array( 'key' => '_EventHideFromUpcoming', 'value' => 'yes', 'compare' => '=', ), ), ), );
I've tried reducing my query down to simply getting one result with "_EventHideFromUpcoming" set to "yes" but still not able to. I've tried using essentially the same query with different meta keys and it works. It seems like all "_EventHideFromUpcoming" set to "yes" are being filtered out before I run my query.