From f3d325451739012f06f3ddf6b017539712ff4e65 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Tue, 2 Jan 2018 18:10:26 +0000 Subject: [PATCH] Editor: Link suggestions: add fallback title for posts with no title. Fixes #42664. git-svn-id: https://develop.svn.wordpress.org/trunk@42425 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wplink/plugin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/js/tinymce/plugins/wplink/plugin.js b/src/wp-includes/js/tinymce/plugins/wplink/plugin.js index 2a7f697368..f20d7c9d89 100644 --- a/src/wp-includes/js/tinymce/plugins/wplink/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wplink/plugin.js @@ -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 $( '
  • ' ) - .append( '' + item.title + ' ' + item.info + '' ) + .append( '' + title + ' ' + item.info + '' ) .appendTo( ul ); };