• Looking for solutions to make the Add to Google Calendar button open in new tab.
    Installed and activated The Events Calendar Extension: Open external links in a new tab. It didn’t change the Add to GCal button.
    Next, added the code from github in functions.php of the theme.
    The links in the event now open in new tab, but Add to GCal still opens in same tab.
    It is unprofessional to send users off website and have to resolve. Thank you for help.
    This is code added:
    add_filter( ‘tribe_get_event_website_link_target’, ‘cliff_blank_target_for_new_window’ );
    add_filter( ‘tribe_get_event_organizer_link_target’, ‘cliff_blank_target_for_new_window’ );
    add_filter( ‘tribe_get_venue_website_link_target’, ‘cliff_blank_target_for_new_window’ );
    function cliff_blank_target_for_new_window() {
    return ‘_blank’;
    }`

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support iammarta

    (@iammarta)

    Hi @leelalove ,

    Thanks for reaching out!

    Try editing line 132 on /the-events-calendar/src/Tribe/ical.php and add in target=”_blank”.

    For reference:

    $calendar_links .= '<a class="tribe-events-gcal tribe-events-button" href="' . Tribe__Events__Main::instance()->esc_gcal_url( tribe_get_gcal_link() ) . '" title="' . esc_attr__( 'Add to Google Calendar', 'the-events-calendar' ) . '" target="_blank">+ ' . esc_html__( 'Google Calendar', 'the-events-calendar' ) . '</a>';

    Best regards,
    Marta

    Hi there!

    This thread has been inactive for a while so I’ll be marking it as Resolved.

    Please feel free to open a new thread if any other questions come up and we’d be happy to help.

    Best regards,

    Marho

    James Welbes

    (@highprrrr)

    @leelalove Good news!

    The bug fix is here! Please update your plugins and let us know how it goes.

    Thanks for your patience while we worked on this.

    -James

    Hello,
    I’ve tried updating php and uploading this extension https://theeventscalendar.com/extensions/external-event-links-in-a-new-tab/ – still not working even after just updating the plugin to Version 5.14.0.4 – can you please help?

    I can get all other links to open in a new window, just not the Google Calendar or iCalendar links

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘open add to calendar link in new tab’ is closed to new replies.