[wp-trac] [WordPress Trac] #34111: Menu CSS Classes are saved as comma separated inside the Customiser

WordPress Trac noreply at wordpress.org
Fri Oct 2 08:36:32 UTC 2015


#34111: Menu CSS Classes are saved as comma separated inside the Customiser
--------------------------+--------------------------
 Reporter:  paulwilde     |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.3.2
Component:  Customize     |     Version:  4.3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------
Changes (by tyxla):

 * keywords:  needs-patch => has-patch


Comment:

 Since the `classes` property is an array, it is automatically
 `toString()`-ed before being inserted as a value of the "CSS Classes"
 input field.

 The above patch handles this by manually turning the array into string,
 concatenating the classes by a space `" "`. This will avoid the automatic
 `toString()` which turns the spaces into commas.

 Side note: We can implement this for any `array` properties, but I
 consider that we should do this only for `classes` property. Reason: we
 should respect potential menu item element properties for other types of
 fields that would use arrays (for example sets of checkboxes or `<select
 multiple>`). Such fields can currently be added by overriding the default
 admin menu walker.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34111#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list