1st post on this forum so sorry if not enough detail passed.
I am trying to use WP_Query to gather CPT that have an Advanced Custom Field (WP Plugin) of "End Date", the field is a date picker. I want the Query to return all posts that are before their individual "End Date" and all posts that don't have an "End Date" incase the user doesn't know/want to add one. Basically, I don't want posts to make it through the query if the "End Date" has passed.
Below is what I have tried so far with little success
$meta_query = array( 'relation' => 'OR', array( 'key' => 'vacancy_end_date', 'value' => date('Ymd'), 'type' => 'DATE', 'compare' => '>=' ), array( 'key' => 'vacancy_end_date', 'value' => '', 'type' => 'DATE', 'compare' => '=' ) ); $args = [ 'post_type' => 'vacancy', // origionally 9 'posts_per_page' => -1, 'meta_key' => 'vacancy_end_date', 'meta_query' => $meta_query, ]; $posts = new \WP_Query($args);