What’s the code in the make_clickable function? All you need ot do is edit that to add in the extra code to make the link open in a new window.
Whoa! catacaustic clearly does not realize that make_clickable() is a WP core function! We never edit core functions and catacaustic knows this 🙂
Unfortunately, this function is lacking any kind of filter that we often see in core, so your only clean recourse is to copy the source code into a child theme or your own plugin, giving it a new name, editing as needed, then calling it by the new name. It’s in /wp-includes/formatting.php.
The only thing to change here is the callback function (line 2236 in formatting.php) _make_url_clickable_cb. You’ll need to copy and rename the source for this function too (also in formatting.php, a few functions up from make_clickable()). In the callback all you need to do is edit the return string at the end of the function to this:
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\" target=\"_blank\" >$url</a>" . $suffix;
You’re right bcworkz, I did not realise that it was a core function. I’ll jsut get my geek card ready to hand in now… 😉
@febday, follow that advice above. It’s the best way to do what you’re after.