Skip to content

Instantly share code, notes, and snippets.

@pasadamedia
Created November 28, 2014 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pasadamedia/4b828f33fc8a0a9917e5 to your computer and use it in GitHub Desktop.
Save pasadamedia/4b828f33fc8a0a9917e5 to your computer and use it in GitHub Desktop.
Remove and replace Google and iCal links on single event pages, with the link modified to open in new tab.
/**
* Remove and replace Google and iCal links on single event pages, with the link modified to open in new tab.
*
*/
remove_action( 'tribe_events_single_event_after_the_content', array( 'TribeiCal', 'single_event_links' ) );
add_action('tribe_events_single_event_after_the_content', 'tribe_add_cal_link');
function tribe_add_cal_link() {
// don't show on password protected posts
if (is_single() && !post_password_required()) {
echo '<div class="tribe-events-cal-links">';
echo '<a class="tribe-events-gcal tribe-events-button" target="_blank" href="' . tribe_get_gcal_link() . '" title="' . __( 'Add to Google Calendar', 'tribe-events-calendar' ) . '">+ ' . __( 'Google Calendar', 'tribe-events-calendar-pro' ) . '</a>';
echo '<a class="tribe-events-ical tribe-events-button" target="_blank" href="' . tribe_get_single_ical_link() . '">+ ' . __( 'iCal Import', 'tribe-events-calendar' ) . '</a>';
echo '</div><!-- .tribe-events-cal-links -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment