brook-tribe

Hide Google Calendar and/or iCal single event links

Jun 10th, 2014
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. /*
  2.  * Removes the Google Calendar and iCal single event links
  3.  */
  4.  
  5. add_action('tribe_events_single_event_before_the_content', 'tribe_remove_single_event_links');
  6.  
  7. function tribe_remove_single_event_links () {
  8.     remove_action( 'tribe_events_single_event_after_the_content', array( 'TribeiCal', 'single_event_links' ) );
  9. }
  10.  
  11. /*
  12.  * Uncomment the following action to add the Google Calendar Link
  13.  */
  14.  
  15. //add_action('tribe_events_single_event_after_the_content', 'tribe_add_gcal_link');
  16.  
  17. function tribe_add_gcal_link()  {
  18.  
  19.     // don't show on password protected posts
  20.     if (is_single() && !post_password_required()) {
  21.         echo '<div class="tribe-events-cal-links">';
  22.         echo '<a class="tribe-events-gcal tribe-events-button" href="' . tribe_get_gcal_link() . '" title="' . __( 'Add to Google Calendar', 'tribe-events-calendar' ) . '">+ ' . __( 'Google Calendar', 'tribe-events-calendar-pro' ) . '</a>';
  23.         echo '</div><!-- .tribe-events-cal-links -->';
  24.     }
  25.  
  26. }
  27.  
  28. /*
  29.  * Uncomment the following action to add the iCal Link
  30.  */
  31.  
  32. //add_action('tribe_events_single_event_after_the_content', 'tribe_add_ical_link');
  33.  
  34. function tribe_add_ical_link()  {
  35.  
  36.     // don't show on password protected posts
  37.     if (is_single() && !post_password_required()) {
  38.         echo '<div class="tribe-events-cal-links">';
  39.         echo '<a class="tribe-events-ical tribe-events-button" href="' . tribe_get_single_ical_link() . '">+ ' . __( 'iCal Import', 'tribe-events-calendar' ) . '</a>';
  40.         echo '</div><!-- .tribe-events-cal-links -->';
  41.     }
  42.  
  43. }
Add Comment
Please, Sign In to add comment