Resolved by author
Overview of the issue
When using the WP Event Manager and its iCal addon with WPML, you may encounter that the ICS file download functionality breaks. Specifically, the download link redirects incorrectly when WPML is active, preventing the ICS file from being downloaded.
Workaround
Please, make sure of having a full site backup of your site before proceeding.
- Add the following code to your theme’s function.php file.
- Replace:
// WPML Workaround for compsupp-7348 function wpml_compsupp7348_filter_wpml_post_parse_query($q) { if ( $q->is_feed && isset($q->query_vars['post_type']) && $q->query_vars['post_type'] === 'event_listing' && isset($q->query_vars['feed']) && $q->query_vars['feed'] === 'single-event-listings-ical' ) { $q->query_vars['p'] = 0; } return $q; } add_filter('wpml_post_parse_query', 'wpml_compsupp7348_filter_wpml_post_parse_query');