Make WordPress Core

Ticket #34755: 34755.diff

File 34755.diff, 1.8 KB (added by ryankienstra, 8 years ago)
  • src/wp-admin/js/customize-nav-menus.js

    diff --git src/wp-admin/js/customize-nav-menus.js src/wp-admin/js/customize-nav-menus.js
    index 6dea2b4..b525424 100644
     
    805805                /**
    806806                 * @param {array} themeLocations
    807807                 */
    808                 updateAssignedLocationsInSectionTitle: function( themeLocations ) {
     808                updateAssignedLocationsInSectionTitle: function( themeLocationSlugs ) {
    809809                        var section = this,
    810810                                $title;
    811811
    812812                        $title = section.container.find( '.accordion-section-title:first' );
    813813                        $title.find( '.menu-in-location' ).remove();
    814                         _.each( themeLocations, function( themeLocation ) {
     814                        _.each( themeLocationSlugs, function( themeLocationSlug ) {
    815815                                var $label = $( '<span class="menu-in-location"></span>' );
    816                                 $label.text( api.Menus.data.l10n.menuLocation.replace( '%s', themeLocation ) );
     816                                var locationName = api.Menus.data.locationSlugMappedToName[ themeLocationSlug ];
     817                                $label.text( api.Menus.data.l10n.menuLocation.replace( '%s', locationName ) );
    817818                                $title.append( $label );
    818819                        });
    819820
    820                         section.container.toggleClass( 'assigned-to-menu-location', 0 !== themeLocations.length );
     821                        section.container.toggleClass( 'assigned-to-menu-location', 0 !== themeLocationSlugs.length );
    821822
    822823                },
    823824
  • src/wp-includes/class-wp-customize-nav-menus.php

    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 { 
    381381                                'nav_menu'      => $temp_nav_menu_setting->default,
    382382                                'nav_menu_item' => $temp_nav_menu_item_setting->default,
    383383                        ),
     384                        'locationSlugMappedToName' => get_registered_nav_menus(),
    384385                );
    385386
    386387                $data = sprintf( 'var _wpCustomizeNavMenusSettings = %s;', wp_json_encode( $settings ) );