Advertisement
brook-tribe

Change Event Link to Event Website URL

Sep 18th, 2014
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. // LATEST VERSION CAN BE FOUND HERE: https://gist.github.com/elimn/5bac70de00ec92804dc7
  2.  
  3. // This changes the event link to the website URL link if that is set
  4. add_filter('tribe_get_event_link', 'tribe_set_link_website');
  5.  
  6. function tribe_set_link_website ($link) {
  7.     $website_url = tribe_get_event_website_url();
  8.  
  9.     // Only swaps link if set
  10.     if (!empty($website_url)) {
  11.         $link = $website_url;
  12.     }
  13.  
  14.     return $link;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement