Editor: Link suggestions: add fallback title for posts with no title.

Props afercia.
Merges [42425] to the 4.9 branch.
Fixes #42664.
Built from https://develop.svn.wordpress.org/branches/4.9@42439


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-01-12 20:13:38 +00:00
parent 089aa052fb
commit b8ebacbf82
3 changed files with 5 additions and 2 deletions

View File

@ -468,8 +468,11 @@
}
}
} ).autocomplete( 'instance' )._renderItem = function( ul, item ) {
var fallbackTitle = ( typeof window.wpLinkL10n !== 'undefined' ) ? window.wpLinkL10n.noTitle : '',
title = item.title ? item.title : fallbackTitle;
return $( '<li role="option" id="mce-wp-autocomplete-' + item.ID + '">' )
.append( '<span>' + item.title + '</span>&nbsp;<span class="wp-editor-float-right">' + item.info + '</span>' )
.append( '<span>' + title + '</span>&nbsp;<span class="wp-editor-float-right">' + item.info + '</span>' )
.appendTo( ul );
};

File diff suppressed because one or more lines are too long