Skip to content

Instantly share code, notes, and snippets.

@afragen
Created May 5, 2012 03:17
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 afragen/2599350 to your computer and use it in GitHub Desktop.
Save afragen/2599350 to your computer and use it in GitHub Desktop.
Add alarm to The Events Calendar Pro WP Plugin
<?php
add_filter( 'tribe_ical_feed_item', 'tribe_ical_add_alarm', 10, 2 );
function tribe_ical_add_alarm( $item, $eventPost ) {
$alarm = tribe_get_custom_field( 'Alarm', $eventPost->ID );
if ( !empty( $alarm ) && is_numeric( $alarm ) ) {
$item[] = 'BEGIN:VALARM';
$item[] = 'TRIGGER:-PT' . $alarm . "M";
$item[] = 'END:VALARM';
}
return $item;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment