ORM order by start_date not working
-
The ORM order_by for start_date does not appear to be working. My code has the following:
$events = tribe_events()->where( 'starts_on_or_after', '2024-09-01' )->order_by( 'start_date', 'ASC' )->get_ids();
The ids returned are in ascending id order, not ascending start date order.
Replacing the code by:
$events = tribe_events()->where( 'starts_on_or_after', '2024-09-01' )->order_by( 'meta_value', 'ASC' )->get_ids();
Does get the correct order – presumably because the start_date query is really a meta data query on _EventStartDateUTC and in WP_Query you can specify ordering on that.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.