How to modify query args for ICS export
-
I am trying to figure out a way to allow users to subscribe to a specific category of events.
Currently, my goal is to simply generate an .ics file containing the filtered events. I found the following filter hooks, which looked promising:
// File: the-events-calendar/src/Tribe/iCal.php // Line: 968 protected function get_events_list( $args = [], $query = null ) { $args = apply_filters( 'tribe_events_ical_events_list_args', $args ); $query = apply_filters( 'tribe_events_ical_events_list_query', $query ); ..rest of function... }However, I cannot figure out any way to trigger them. The get_events_list() function is only called in the get_events_posts() function (same file), but the line(s) that call it are never reached because $this->post is always truthy:
// File: the-events-calendar/src/Tribe/iCal.php // Line: 369 protected function get_event_posts() { if ( $this->post ) { return is_array( $this->post ) ? $this->post : [ $this->post ]; } ...rest of function.. }I have tried the following URLs, but none have triggered the filters mentioned above:
- https://mysite.com/?post_type=tribe_events&ical=1&eventDisplay=list
- https://mysite.com/?post_type=tribe_events&ical=1
- https://mysite.com/?ical=1
- https://mysite.com/?ical=1&view=test
Can you offer any advice on how to trigger these hooks? Or else, how to modify the output of the ical feed?
The topic ‘How to modify query args for ICS export’ is closed to new replies.