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. 

Cherry-picks [34788].

Props tyxla, westonruter.
Fixes #34111 for 4.3.

Built from https://develop.svn.wordpress.org/branches/4.3@34789


git-svn-id: http://core.svn.wordpress.org/branches/4.3@34754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2015-10-03 00:20:25 +00:00
parent 0b2de83d41
commit 20596916c3
2 changed files with 7 additions and 3 deletions

View File

@ -1132,7 +1132,11 @@
}
});
if ( settingValue ) {
element.set( settingValue[ property ] );
if ( ( property === 'classes' || property === 'xfn' ) && _.isArray( settingValue[ property ] ) ) {
element.set( settingValue[ property ].join( ' ' ) );
} else {
element.set( settingValue[ property ] );
}
}
});

File diff suppressed because one or more lines are too long