Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Created September 27, 2012 02:54
Show Gist options
  • Save jo-snips/3791894 to your computer and use it in GitHub Desktop.
Save jo-snips/3791894 to your computer and use it in GitHub Desktop.
The Events Calendar: Filter Google Calendar Params
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