Make WordPress Core

Changeset 42439 for branches/4.9


Ignore:
Timestamp:
01/12/2018 08:12:11 PM (9 years ago)
Author:
SergeyBiryukov
Message:

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

Props afercia.
Merges [42425] to the 4.9 branch.
Fixes #42664.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/js/tinymce/plugins/wplink/plugin.js

    r41393 r42439  
    469469                                                }
    470470                                        } ).autocomplete( 'instance' )._renderItem = function( ul, item ) {
     471                                                var fallbackTitle = ( typeof window.wpLinkL10n !== 'undefined' ) ? window.wpLinkL10n.noTitle : '',
     472                                                        title = item.title ? item.title : fallbackTitle;
     473
    471474                                                return $( '<li role="option" id="mce-wp-autocomplete-' + item.ID + '">' )
    472                                                 .append( '<span>' + item.title + '</span>&nbsp;<span class="wp-editor-float-right">' + item.info + '</span>' )
     475                                                .append( '<span>' + title + '</span>&nbsp;<span class="wp-editor-float-right">' + item.info + '</span>' )
    473476                                                .appendTo( ul );
    474477                                        };
Note: See TracChangeset for help on using the changeset viewer.