I have the following function which returns only future events, which works great:
$args = array(
'post_type' => self::POST_TYPE,
'posts_per_page' => $posts_per_page,
'meta_key' => 'start_date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'status' => 'publish',
'meta_query' => array(
array(
'key' => 'start_date',
'value' => date('Ymd'),
'compare' => '>=',
'type' => 'DATE'
)
)
);
The problem I have is, I also need to check whether a custom field called “post_is_global” has been set (the type is BOOL by the way) but I don’t know how to implement it into this query. Any help would be greatly appreciated.
Many thanks!
The query should look somewhat like this:
References: