Created
November 28, 2014 13:11
-
-
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.
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
/** | |
* 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