Edit wp-admin/quicktags.js so it will be added automatically. Look for this function near the end of the js file:
edInsertLink(myField, i, defaultValue)
In the function change this line:
edButtons[i].tagStart = '<a href="' + URL + '">';
to:
edButtons[i].tagStart = '<a target="_new" href="' + URL + '">';
Hey Kafkaesqui,
I was trying to figure that out too. Just made the edit, but links still do not open in new window. Any other ideas???
Thanks, Linda
Linda:
1. If you edited quicktags.js offline, you uploaded it to the correct directory (wp-admin/)?
2. If your in the WP edit panel at the time, did you perform a hard-refresh of the page to reload the Quicktags javascript?
3. You’re using the link Quicktag button to enter links in your post?
Yes thanks I did all that and double checked it. Plus just tried again after hard refresh. I’m not a coder but your instructions were great and I’m sure I did it right.
Can you tell anything by looking at my source code?
http://affiliate-blogs.5staraffiliateprograms.com/
Thanks so much!
Nevermind – got it to work! I had only hit refresh before. Had to close my FF browser and then open a new one and it worked. Thanks this is AWESOME!!!
target=”_new” is deprecated. A better way is to add rel=”external” and then use this code.
target=”_new” is annoying. A better way is to let your readers decide for themselves whether they want to open a new browser window.