Customize: Ensure nav menu items lacking a label use the title from the original object.

Use original title as placeholder for label and in control title. Prevent original title from overriding empty label in initial setting values.

Fixes #38015.


git-svn-id: https://develop.svn.wordpress.org/trunk@38618 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2016-09-17 21:49:49 +00:00
parent 998c06222f
commit 87dc042623
5 changed files with 116 additions and 16 deletions
+2 -2
View File
@@ -1397,14 +1397,14 @@
}
var titleEl = control.container.find( '.menu-item-title' ),
titleText = item.title || api.Menus.data.l10n.untitled;
titleText = item.title || item.original_title || api.Menus.data.l10n.untitled;
if ( item._invalid ) {
titleText = api.Menus.data.l10n.invalidTitleTpl.replace( '%s', titleText );
}
// Don't update to an empty title.
if ( item.title ) {
if ( item.title || item.original_title ) {
titleEl
.text( titleText )
.removeClass( 'no-title' );