Advertisement
BakerMan

Remove trailing slashes from event links

Jul 31st, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.24 KB | None | 0 0
  1. function tribe_get_unslashed_event_link() {
  2.     $link = tribe_get_event_link();
  3.     $last_slash = strrpos($link, '/');
  4.     $link_length = strlen($link) - 1;
  5.  
  6.     if ($last_slash === $link_length) $link = substr($link, 0, $link_length);
  7.     return $link;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement