• Resolved bobbykjack

    (@bobbykjack)


    How can I disable the ‘open link in new window’ option available when adding a link in the text editor?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    A blogroll link or just a link in your post?

    Either way, someone can right-click and open-in-new.

    Thread Starter bobbykjack

    (@bobbykjack)

    A link in a post. I don’t want to prevent users from opening the link however they wish, this is precisely the reason I want to stop content authors from forcing links to open in a new window! 🙂

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Eh. Not sure you can.

    By default the link goes to the same ‘tab/window’ whatever. If they’re putting in <a href=http://foo.com target=_new> then I don’t think you can stop them from being that way.

    Thread Starter bobbykjack

    (@bobbykjack)

    Yeah, I don’t mind TOO much about the HTML issue – these aren’t the type of people who will go in and edit the code by hand! But when they use the ‘insert link’ icon in the ‘WYSIWYG’ editor, the dialog that appears has a ‘Target’ drop-down which can be set to ‘open in new window’. That’s what I’d like to remove.

    I guess I might have to go in and hack the code myself to remove it …

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Oh! (See I never use the visual editor…) Yeah. Unless you can strip the function or have them both act the same way, it may be a hack 🙁

    Thread Starter bobbykjack

    (@bobbykjack)

    Well, in case anyone’s interested, the quick hack way is to edit wp-includes/js/tinymce/themes/advanced/link.htm and comment out the appropriate table row. In my version, it contains a select named target_list and is on lines 37-40.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to disable ‘open in new window’’ is closed to new replies.