I want to get posts according to the following logic:
"If post status = publish or pending then get all records which have a meta value of less than todays date. If the post is in trash, get it regardless of meta query"
So I have the following args but these bring in only the trash posts that have meta value of less than todays date and I want to get all trash posts.
$args = array( 'posts_per_page' => -1, 'post_type' => 'jobs', 'post_status' => 'pending, publish, trash', 'author' => $current_user->ID, 'meta_key' => 'JOBS_ad_end', 'meta_query' => array( array( 'key' => 'JOBS_ad_end', 'value' => date("Y-m-d"), 'compare' => '<=', 'type' => 'NUMERIC,' ) ) ); $posts = get_posts($args);
I'm guessing this probably isn't even possible and will need a custom query, but thought I'd check if anyone knows a way to do it.