<?php
/**
* The Events Calendar: Make event links open in a new window.
*
* To be used in conjunction with the "Make Event Titles Link to the Event
* Website URL" extension.
*
* @link https://theeventscalendar.com/extensions/make-event-titles-link-to-the-event-website-url/
* @link https://gist.github.com/cliffordp/3bdd3857f905c0927dc5c5594f97e319
*/
function tec_event_links_open_new_window( $link ) {
$link = str_replace( '<a href="', '<a target="_blank" href="', $link );
return $link;
}
add_filter ( 'tribe_events_get_event_link', 'tec_event_links_open_new_window' );