Created
September 27, 2012 02:54
-
-
Save jo-snips/3791894 to your computer and use it in GitHub Desktop.
The Events Calendar: Filter Google Calendar Params
This file contains 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
function filter_google_cal_params($params) { | |
global $post; | |
$event_details = substr( strip_shortcodes(get_the_content()), 0, 996 ) . '...'; | |
$params = array( | |
'action' => 'TEMPLATE', | |
'text' => str_replace( ' ', '+', strip_tags( urlencode( $post->post_title ) ) ), | |
'dates' => $dates, | |
'details' => str_replace( ' ', '+', strip_tags( apply_filters( 'the_content', urlencode( $event_details ) ) ) ), | |
'location' => str_replace( ' ', '+', urlencode( $location ) ), | |
'sprop' => get_option( 'blogname' ), | |
'trp' => 'false', | |
'sprop' => 'website:' . home_url(), | |
); | |
return $params; | |
} | |
add_filter('tribe_google_calendar_parameters','filter_google_cal_params'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment