public this repo is viewable by everyone
Description: Wordpress plugin to add target='_blank' to external links
Homepage: http://veilleperso.com
Clone URL: git://github.com/veilleperso/or_target_blank.git
Add 'external' class on external link, to allow different link css for 
external links
veilleperso (author)
6 days ago
commit  cec745eca3ea911e816074491ff98c5cc8bab2a5
tree    c4f3d2b13a760c24a833548c3ea96ebda049ded8
parent  1ff3828c5fcf548e1aed9e871939f28b76d48f82
...
11
12
13
14
15
 
 
16
17
18
...
11
12
13
 
 
14
15
16
17
18
0
@@ -11,8 +11,8 @@
0
 define('OR_INTERNAL_LINK', "/^".preg_quote(get_option("siteurl"), "/i")."/");
0
 
0
 function or_convert_external_link($matches) {
0
- if (preg_match(OR_INTERNAL_LINK, $matches[2])) return "<a href=\"$matches[2]\"$matches[1]$matches[3]>";
0
- else return "<a href=\"$matches[2]\"$matches[1]$matches[3] target=\"_blank\">";
0
+ if (preg_match(OR_INTERNAL_LINK, $matches[2])) return $matches[0];
0
+ else return "<a$matches[1]href=\"$matches[2]\"$matches[3] target=\"_blank\" class=\"external\">";
0
 }
0
   
0
 function or_external_link($text) {

Comments

    No one has commented yet.