Advertisement
BakerMan

Make featured img link to full size img (TEC 3.0)

Jul 24th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. add_filter('tribe_event_featured_image', 'tribe_featured_img_link_to_full_size', 10, 4);
  2.  
  3. function tribe_featured_img_link_to_full_size($html, $post_id, $size, $image_src) {
  4.     $href_start = strpos($html, '<a href="http');
  5.     $href_end = $href_start ? strpos($html, '"', $href_start + 12) : 0;
  6.  
  7.     if (false === $href_start) return $html;
  8.     else return substr_replace($html, '<a href="' . $image_src[0], $href_start, $href_end - $href_start);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement