Skip to content

Instantly share code, notes, and snippets.

@tarfoot
Last active October 26, 2016 17:54
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 tarfoot/a0c0c2c11467aa86556b0dc34e34c44e to your computer and use it in GitHub Desktop.
Save tarfoot/a0c0c2c11467aa86556b0dc34e34c44e to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: The Events Calendar - Add to Calendar Buttons
Description: Change the copy in the Add to Calendar export buttons in The Events Calendar plugin
Version: 1.1.1
Author: Tarfoot Consulting, Inc.
Author URI: http://tarfoot.com
*/
// Changes the text labels for Google Calendar and iCal buttons on a single event page on The Events Calendar plugin for Wordpress
// From https://theeventscalendar.com/knowledgebase/change-the-text-for-ical-and-google-calendar-export-buttons/
add_action( 'init', 'tribe_really_remove_action_single_event_links' );
function tribe_really_remove_action_single_event_links() {
remove_action( 'tribe_events_single_event_after_the_content', array( 'Tribe__Events__iCal', 'single_event_links' ) );
}
add_action( 'tribe_events_single_event_after_the_content', 'customized_tribe_single_event_links' );
function customized_tribe_single_event_links() {
if (is_single() && post_password_required()) {
return;
}
echo '<div class="tribe-events-cal-links">';
echo '<a class="tribe-events-gcal tribe-events-button" href="' . tribe_get_gcal_link() . '" title="' . __( 'Add to Google Calendar', 'tribe-events-calendar-pro' ) . '">+ Add to Google Calendar</a>';
echo '<a class="tribe-events-ical tribe-events-button" href="' . tribe_get_single_ical_link() . '">+ Add to Outlook / iCal</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