Created
May 5, 2012 03:17
-
-
Save afragen/2599350 to your computer and use it in GitHub Desktop.
Add alarm to The Events Calendar Pro WP Plugin
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
<?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