WordPress.org

Make WordPress Core

Changeset 42425 for trunk


Ignore:
Timestamp:
01/02/2018 06:10:26 PM (22 months ago)
Author:
afercia
Message:

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

Fixes #42664.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js

    r41393 r42425  
    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.