Last active
October 21, 2020 18:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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