From 2ef0449316d67b4bb533a7dbcdd8430248e22e0b Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sat, 3 Oct 2015 00:14:22 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@34788 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-nav-menus.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/customize-nav-menus.js b/src/wp-admin/js/customize-nav-menus.js index f5296b65d2..2b0ed041ab 100644 --- a/src/wp-admin/js/customize-nav-menus.js +++ b/src/wp-admin/js/customize-nav-menus.js @@ -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 ] ); + } } });