Last active
January 30, 2020 15:27
-
-
Save pixeldevsio/7c376c0cef7545b97072ffb23c8e26a3 to your computer and use it in GitHub Desktop.
Modify Google Calendar link parameters for Tribe Events Calendar (includes multi-day events)
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 | |
/** | |
* Change Google Calendar description and title | |
*/ | |
function tribe_google_calendar_link_modify( $params ) { | |
// unset parameters | |
unset($params['details']); | |
unset($params['text']); | |
// Declare Variables | |
$endTime = tribe_get_end_date($eventPost->ID, false, 'Hi'); | |
$mod = tribe_get_event_link(); | |
// Make sure it's a multi-day event | |
if(tribe_event_is_multiday()){ | |
// if the time is 11:59pm | |
if($endTime == '2359'){ | |
// Summary is the title | |
$params['text'] = get_the_title() . ' - Ending time not correct '; | |
} | |
} | |
// change the description to the link only | |
$params['details'] = $mod; | |
return $params; | |
} | |
add_filter( 'tribe_google_calendar_parameters', 'tribe_google_calendar_link_modify', 10, 2 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment