Skip to content

Instantly share code, notes, and snippets.

@elimn
Created November 13, 2015 22:37
Show Gist options
  • Select an option

  • Save elimn/c69e058933789da250f5 to your computer and use it in GitHub Desktop.

Select an option

Save elimn/c69e058933789da250f5 to your computer and use it in GitHub Desktop.
MT | TEC | Truncate lengthy Event Website URL Labels
<?php
/*
* Truncates (trims) the Event Website URL label when its too lengthy
*/
function tribe_event_website_truncator ( $label ) {
// Change this to adjust when the truncator starts trimming characters
$max_length = 25;
if( strlen($label) > $max_length ) {
$label = substr($label, 0, $max_length - 3) . '&hellip;';
}
return $label;
}
add_filter('tribe_get_event_website_link_label', 'tribe_event_website_truncator');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment