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
This commit is contained in:
Andrea Fercia 2018-01-02 18:10:26 +00:00
parent d91095f34a
commit f3d3254517
1 changed files with 4 additions and 1 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 );
};