diff --git src/wp-admin/js/customize-nav-menus.js src/wp-admin/js/customize-nav-menus.js
index 6dea2b4..3bcbb2c 100644
|
|
|
24 | 24 | defaultSettingValues: { |
25 | 25 | nav_menu: {}, |
26 | 26 | nav_menu_item: {} |
27 | | } |
| 27 | }, |
| 28 | locationSlugMappedToName: {} |
28 | 29 | }; |
29 | 30 | if ( 'undefined' !== typeof _wpCustomizeNavMenusSettings ) { |
30 | 31 | $.extend( api.Menus.data, _wpCustomizeNavMenusSettings ); |
… |
… |
|
805 | 806 | /** |
806 | 807 | * @param {array} themeLocations |
807 | 808 | */ |
808 | | updateAssignedLocationsInSectionTitle: function( themeLocations ) { |
| 809 | updateAssignedLocationsInSectionTitle: function( themeLocationSlugs ) { |
809 | 810 | var section = this, |
810 | 811 | $title; |
811 | 812 | |
812 | 813 | $title = section.container.find( '.accordion-section-title:first' ); |
813 | 814 | $title.find( '.menu-in-location' ).remove(); |
814 | | _.each( themeLocations, function( themeLocation ) { |
815 | | var $label = $( '<span class="menu-in-location"></span>' ); |
816 | | $label.text( api.Menus.data.l10n.menuLocation.replace( '%s', themeLocation ) ); |
| 815 | _.each( themeLocationSlugs, function( themeLocationSlug ) { |
| 816 | var $label, locationName; |
| 817 | $label = $( '<span class="menu-in-location"></span>' ); |
| 818 | locationName = api.Menus.data.locationSlugMappedToName[ themeLocationSlug ]; |
| 819 | $label.text( api.Menus.data.l10n.menuLocation.replace( '%s', locationName ) ); |
817 | 820 | $title.append( $label ); |
818 | 821 | }); |
819 | 822 | |
820 | | section.container.toggleClass( 'assigned-to-menu-location', 0 !== themeLocations.length ); |
| 823 | section.container.toggleClass( 'assigned-to-menu-location', 0 !== themeLocationSlugs.length ); |
821 | 824 | |
822 | 825 | }, |
823 | 826 | |
diff --git src/wp-includes/class-wp-customize-nav-menus.php src/wp-includes/class-wp-customize-nav-menus.php
index 5453c17..b4e1c60 100644
|
|
final class WP_Customize_Nav_Menus { |
381 | 381 | 'nav_menu' => $temp_nav_menu_setting->default, |
382 | 382 | 'nav_menu_item' => $temp_nav_menu_item_setting->default, |
383 | 383 | ), |
| 384 | 'locationSlugMappedToName' => get_registered_nav_menus(), |
384 | 385 | ); |
385 | 386 | |
386 | 387 | $data = sprintf( 'var _wpCustomizeNavMenusSettings = %s;', wp_json_encode( $settings ) ); |
diff --git tests/qunit/fixtures/customize-menus.js tests/qunit/fixtures/customize-menus.js
index 8478510..cf4176e 100755
|
|
window._wpCustomizeNavMenusSettings = { |
102 | 102 | 'taxonomyTermLabel': 'Taxonomy', |
103 | 103 | 'unnamed': '(unnamed)', |
104 | 104 | 'untitled': '(no label)' |
| 105 | }, |
| 106 | 'locationSlugMappedToName': { |
| 107 | 'main-footer': 'Main Footer', |
| 108 | 'main-header': 'Main Header' |
105 | 109 | } |
106 | 110 | }; |
107 | 111 | window._wpCustomizeSettings.panels.nav_menus = { |