Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Strips HTML code from Google Calendar descriptions
- function tribe_strip_gcal_description_html ($params) {
- // Decode content
- $params['details'] = html_entity_decode(urldecode($params['details']));
- // Hack: Add space after paragraph
- // Normally Google Cal understands the newline character %0a
- // And that character will automatically replace newlines on urlencode()
- // However, WP' esc_url() function strips %0a from URLs
- $params['details'] = str_replace ('</p>', '</p> ', $params['details']);
- // Remove HTML
- $params['details'] = strip_tags($params['details']);
- // Encode for URl
- $params['details'] = urlencode($params['details']);
- return $params;
- }
- add_filter('tribe_google_calendar_parameters', 'tribe_strip_gcal_description_html');
Add Comment
Please, Sign In to add comment