Skip to content

Instantly share code, notes, and snippets.

@vicskf
Last active October 21, 2020 18:54
Show Gist options
  • Save vicskf/de56fefa54edca17d4292df7fbf187ed to your computer and use it in GitHub Desktop.
Save vicskf/de56fefa54edca17d4292df7fbf187ed to your computer and use it in GitHub Desktop.
TEC > Customize The Events Calendar iCal links to add a rel="nofollow" attribute to the links for SEO purposes
<?php
/**
* Customize The Events Calendar iCal links to add a rel="nofollow" attribute to the links for SEO purposes
*/
add_filter( 'tribe_events_ical_single_event_links', 'my_custom_events_ical_single_event_links' );
function my_custom_events_ical_single_event_links( $calendar_links ) {
$calendar_links = '<div class="tribe-events-cal-links">';
$calendar_links .= '<a class="tribe-events-gcal tribe-events-button" rel="nofollow" href="' . Tribe__Events__Main::instance()->esc_gcal_url( tribe_get_gcal_link() ) . '" title="' . esc_attr__( 'Add to Google Calendar', 'the-events-calendar' ) . '">+ ' . esc_html__( 'Google Calendar', 'the-events-calendar' ) . '</a>';
$calendar_links .= '<a class="tribe-events-ical tribe-events-button" rel="nofollow" href="' . esc_url( tribe_get_single_ical_link() ) . '" title="' . esc_attr__( 'Download .ics file', 'the-events-calendar' ) . '" >+ ' . esc_html__( 'iCal Export', 'the-events-calendar' ) . '</a>';
$calendar_links .= '</div><!-- .tribe-events-cal-links -->';
return $calendar_links;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment