Created
November 13, 2015 22:37
-
-
Save elimn/c69e058933789da250f5 to your computer and use it in GitHub Desktop.
MT | TEC | Truncate lengthy Event Website URL Labels
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 | |
| /* | |
| * 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) . '…'; | |
| } | |
| 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