Make WordPress Core

Changeset 34788 for trunk


Ignore:
Timestamp:
10/03/2015 12:14:22 AM (9 years ago)
Author:
westonruter
Message:

Customize: Fix nav_menu_item CSS classes array being incorrectly presented in input field as comma-delimited list.

Instead of using Array.toString() to serialize an array with comma delimiters, explicitly join the array using spaces instead. Also ensure that xfn is handled properly if it ever gets stored as an array.

Props tyxla, westonruter.
Fixes #34111.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r33859 r34788  
    11331133                });
    11341134                if ( settingValue ) {
    1135                     element.set( settingValue[ property ] );
     1135                    if ( ( property === 'classes' || property === 'xfn' ) && _.isArray( settingValue[ property ] ) ) {
     1136                        element.set( settingValue[ property ].join( ' ' ) );
     1137                    } else {
     1138                        element.set( settingValue[ property ] );
     1139                    }
    11361140                }
    11371141            });
Note: See TracChangeset for help on using the changeset viewer.