Make WordPress Core

Changeset 34789


Ignore:
Timestamp:
10/03/2015 12:19:17 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.

Cherry-picks [34788].

Props tyxla, westonruter.
Fixes #34111 for 4.3.

Location:
branches/4.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3

  • branches/4.3/src/wp-admin/js/customize-nav-menus.js

    r33943 r34789  
    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.