: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// Returns a jQuery object containing the menu element.
.autocomplete( 'widget' )
.addClass( 'wplink-autocomplete' )
.attr( 'role', 'listbox' )
.removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI.
* Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
* The `menufocus` and `menublur` events are the same events used to add and remove
* the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
.on( 'menufocus', function( event, ui ) {
ui.item.attr( 'aria-selected', 'true' );
.on( 'menublur', function() {
* The `menublur` event returns an object where the item is `null`
* so we need to find the active item with other means.
$( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' );
tinymce.$( input ).on( 'keydown', function( event ) {
if ( event.keyCode === 13 ) {
editor.execCommand( 'wp_link_apply' );
editor.on( 'wptoolbar', function( event ) {
var linkNode = editor.dom.getParent( event.element, 'a' ),
if ( typeof window.wpLink !== 'undefined' && window.wpLink.modalOpen ) {
editToolbar.tempHide = true;
editToolbar.tempHide = false;
$linkNode = editor.$( linkNode );
href = $linkNode.attr( 'href' );
edit = $linkNode.attr( 'data-wplink-edit' );
if ( href === '_wp_link_placeholder' || edit ) {
if ( href !== '_wp_link_placeholder' && ! inputInstance.getURL() ) {
inputInstance.setURL( href );
event.element = linkNode;
event.toolbar = editToolbar;
} else if ( href && ! $linkNode.find( 'img' ).length ) {
previewInstance.setURL( href );
event.element = linkNode;
if ( $linkNode.attr( 'data-wplink-url-error' ) === 'true' ) {
toolbar.$el.find( '.wp-link-preview a' ).addClass( 'wplink-url-error' );
toolbar.$el.find( '.wp-link-preview a' ).removeClass( 'wplink-url-error' );
} else if ( editToolbar.visible() ) {
editor.execCommand( 'wp_link_cancel' );
editor.addButton( 'wp_link_edit', {
tooltip: 'Edit|button', // '|button' is not displayed, only used for context.
icon: 'dashicon dashicons-edit',
editor.addButton( 'wp_link_remove', {
icon: 'dashicon dashicons-editor-unlink',
editor.addButton( 'wp_link_advanced', {
icon: 'dashicon dashicons-admin-generic',
if ( typeof window.wpLink !== 'undefined' ) {
var url = inputInstance.getURL() || null,
text = inputInstance.getLinkText() || null;
window.wpLink.open( editor.id, url, text );
editToolbar.tempHide = true;
editor.addButton( 'wp_link_apply', {
icon: 'dashicon dashicons-editor-break',
classes: 'widget btn primary'
editToolbar.tempHide = false;
editor.execCommand( 'wp_link_cancel' );