[Bug] Using WP_Query to get past events doesnt work if `post_type` is an array
-
Trying to get past events using WP_Query:
php $query = new \WP_Query( [ 'post_type' => [ 'tribe_events' ], 'no_found_rows' => true, 'posts_per_page' => '11', 'meta_query' => [ [ 'key' => '_EventEndDate', 'value' => '2020-12-02', 'compare' => '<', 'type' => 'DATE', ], ], ] );
returns empty.
But if I pass
post_type => 'tribe_events
(i.e. as a string instead of an array), it works fine.You can see the vardump of both functions on a temporary spinup at https://accused-jaguar.jurassic.ninja/
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Bug] Using WP_Query to get past events doesnt work if `post_type` is an array’ is closed to new replies.