[wp-trac] [WordPress Trac] #30225: Customizer panels/sections/controls with equal priorities do not sort in order of addition (was: Customizer controls with same priorities do not sort in order of addition)

WordPress Trac noreply at wordpress.org
Sat Nov 1 05:44:20 UTC 2014


#30225: Customizer panels/sections/controls with equal priorities do not sort in
order of addition
--------------------------+-------------------------
 Reporter:  westonruter   |       Owner:  ocean90
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  4.1
Component:  Customize     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+-------------------------
Changes (by westonruter):

 * keywords:   => has-patch
 * owner:   => ocean90
 * status:  new => reviewing


Comment:

 [attachment:30225.diff] adds stable sorting for panels, sections, controls
 in JS and improves in PHP. Panel, Section, and Control classes get a new
 static protected variable `$instance_count`, and when new instances are
 created this is incremented and the value is stored in an instance's
 `$insance_number`. This value is then used to sort the objects when their
 priorities are equal, thus resulting in a stable sort.

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


More information about the wp-trac mailing list