Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function linkURLsInCustomFields($html) {
- $matches = array();
- $pattern = '#<dd.*>(https?:\\/\\/[a-zA-Z0-9-\\.]+\\.[a-zA-Z0-9-\\.]+)<\/dd>#';
- preg_match($pattern, $html, $matches);
- if (count($matches) == 2) {
- $match = $matches[1];
- $link = '<a href="'.$match.'">'.$match.'</a>';
- $html = str_replace($match, $link, $html);
- }
- return $html;
- }
- add_filter('tribe_the_custom_fields', 'linkURLsInCustomFields');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement