Let's say you want to change the labels for the Google Calendar and iCal download buttons on a single event page. You've seen them before when looking at one of the events on your site. They pop up just below the content for the event and look a little something like this:
If you've poked around the plugin files, you might be driving yourself mad trying to find out where to change those labels and that's because you won't find them there. Thankfully, there's a pretty handy snippet you can add to your theme's functions.php file to change those labels.
This snippet does the following:
- Changes "Google Calendar" to "Export the Map"
- Changed "iCal Export" to "Export to Calendar"
Of course, you can edit the snippet to have those labels say anything you want.
// Changes the text labels for Google Calendar and iCal buttons on a single event page
remove_action( 'tribe_events_single_event_after_the_content', array( tribe( 'tec.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' ) . '">+ Export the Map </a>';
echo '<a class="tribe-events-ical tribe-events-button" href="' . tribe_get_single_ical_link() . '">+ Export to Calendar </a>';
echo '</div>';
}