The Editor in WordPress 4.5

Inline Link Toolbar

From WordPress 4.5 you will be able to link text with an inline toolbar, which replaces the link modal. You will still be able to access the modal with the gear icon in the toolbar, if you’re using one of the advanced fields or are using a plugin that extends the modal. Eventually we will try to move all those fields inline, though still under an advanced toggle and not visible by default. For those interested, see #36312.

Text Patterns

We also added some more text patterns, or shortcuts if you like: `text` will change to <code>text</code> and --- (or more dashes) will change to <hr> while typing. We considered adding patterns for bold and italic, but there was no consensus yet and we’d like to test the inline text patterns first on an HTML tag mostly used by developers. See #33301.

Share this:

Are there any hooks to modify either the text patterns or inline link toolbar? How about for controlling the links list in the inline link? Is it possible to add information such as the post format to that list?

Why would you like this option? We don’t encourage this as it changes default browser behaviour. It should be up to the user to choose whether to open in a new window/tab or not. With this attribute you are forcing it. I know there are some cases where it maybe could be a good idea, but definitely not enough to display the option in the inline toolbar.

You must be kidding. Every website I’ve built using WP has needed links that open in a new window. Whether it’s as simple as a quick external reference, but you don’t want to lose your place on a page, or because of legal reasons,target=” _blank” is used a lot. Clients request this all the time.

adrieet
11:44 am on May 9, 2016

Not sure how to put this: BUT its not your place to tell Millions of Bloggers how to use their external Links by destroying simple functions. If someone wants to make Links open in a new Tab or new Window then then it should be possible. Also please check how many people have installed plugins to set external Links to Nofollow. All this simple functions are made much more difficult and unreliable, with this user unfriendly in line thing. I need 5 tries to set every fu..ing link now. To set a new link or check if a link is set correctly you have to click on the Link thing and then go back to the text and click on the open link editor sh.t. If you added a link in the “in line field” and then click on the “link options” the Link is deleted! Do you discourage Links in general?

Using target=”_blank” (which is used to open in a new window) is often an anti-pattern and there are very few valid use cases for it. It takes away control from the reader, breaks the back button, and is “like a vacuum cleaner sales person who starts a visit by emptying an ash tray on the customer’s carpet”[1].

> We considered adding patterns for bold and italic, but there was no consensus yet and we’d like to test the inline text patterns first on an HTML tag mostly used by developers.

I’d say most people would be just fine with the Markdown asterisks and underscores for emphasis elements (bold and italic). E.g. _this is italic_ and *this is bold*. Just like `code uses backticks` in Markdown.

Now that I think of it we could create a profile system for various formatting shortcuts like IDEs and other software offer profiles for hotkeys? This way people could turn them off, or take a pick from “common” choices, one being Markdown for instance. People can disable the visual editor presently too.

Some time ago I voiced support for Markdown support in the editor feature wishlist, but that was taken down quite instantly. Glad to see Markdown influenced formatting making its way to the editor now. 🙂

I’ll answer that. With this one, it takes more button clicks to get to the window where I can set target_blank, and regardless of what you say, it is expected now with mobile (because the user can’t easily open links in a new tab, and typically they want to). With this one, it has a glitch where sometimes the little inline window won’t go away unless you click something else, click the link button, and click the unlink button. This is a nightmare when creating link roundup posts, which many bloggers do on a weekly basis. Also, in many cases, when I go into the old link modal to set options, it sometimes shows not the current link text I’m working with and have highlighted, but the last link text I finished working with. Thus forcing me to retype the link text in the window.

This is a neat idea, but it introduced so many more problems than solutions for many of us.

I think this addition is an improvement. Currently, the custom added editors I added in a plugin are not handling the links anymore, resulting in a js error. Any tips on how to load custom TinyMCE editors in WP 4.5?
Maybe use another button for “link” in the toolbar? (see snippet below – using the tinyMCE file in the wp-includes dir).

I also would love a way to revert to the old link editor — this change is messing with my workflow. The inline editor will not disappear in Chrome and obscures text after I create a link. It’s now extra clicking and steps to open up the full link editor to make a link nofollow. I used to just be able to highlight, add link, paste link, close, and now have multiple extra clicks and steps — this adds up when you need to add multiple links.

I am seeing problems with the new link editor simply because of the choice of icons used. Clients are clicking the X icon thinking that this is how to close the inline link editor but instead this removes the link.

It would seem much more consistent to use the same “Insert/Edit link” and “Remove link” icons that the main toolbar uses, rather than the pencil and X icons. Doing this would make it more obvious as to the function of these buttons as users are already familiar with the existing icons for adding and removing links.

I am having an issue with initializing the inline link toolbar in a custom instance of the WP editor.

The instance is added in a dynamically loaded modal using the wp_editor function and some JavaScript. It has been working correctly up to WordPress 4.5, but is now broken.

There are some parts that work. When I click the button to add/edit a link, the text does get highlighted as a placeholder, it’s just that the toolbar does not show. The markup for the TinyMCE plugins does get added to the bottom of the document and if I open and close the media editor attached to the new instance, the inline link toolbar will then function correctly.

There are no JavaScript errors when the toolbar is not functioning correctly, it just doesn’t seem as if the JavaScript handlers are bound correctly or something.

This is a bit of a weird one, but I would super appreciate any help or advice that anyone might have.

An update, this issue does appear to be tied in with the Bootstrap modal in which I am adding the instance of wp_editor.

I am not sure what about opening and closing the WordPress media modal makes this come un-stuck. I have tried manually re-focusing on the wpbody-content ID when the modal / editor is initialized using the following code, but that did not work.

Solved.. it turns out the link dialog does not work if the body has the “modal-open” class.

adrieet
11:49 am on May 9, 2016

Can you please tell me how to get the old “user friendly” add link function? The Inline thing is not working most of the time and its much overblown and unusefull. I want many links to open in new tabs and to be nofollow. Before it was much easier. Just click on add link, copy the URL in and add the checkmarks for open in new window and nofollow. Now you have to find the spot where “inline link” thing is and click on the link options. Then it shows me a messy list of pages and blog posts “wtf”. If I add a URL in the in-line and then want to edit the options, the link is deleted.

I do not like the new inline link function at all. I prefer to have the option to open in a new window and add “no follow” without having to click 3 or 4 times. I understand that it’s your opinion that “open in a new window” shouldn’t be forced, but as a reader/user, I prefer it on EVERY website I use and I’ve never had a single complaint on my blog. Besides, the new link editor makes adding links take so much longer with multiple clicks to make the changes I want. Also the inline window will not go away or always display next to the link I’m editing – it’s very glitchy. I think those of use who prefer the options to open up immediately should have it. It’s really disrupting my writing process. Is there a way to go back to the old one? I hate this update!

Nico Martin
9:43 am on May 25, 2016

Hy there I just released a Plugin, that might solve all your problems: