[wp-trac] [WordPress Trac] #37128: Introduce helper function `wp_list_sort()`

WordPress Trac noreply at wordpress.org
Fri Oct 21 16:46:33 UTC 2016


#37128: Introduce helper function `wp_list_sort()`
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  swissspidy
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.7
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests commit      |     Focuses:
  needs-dev-note                                 |
-------------------------------------------------+-------------------------

Comment (by swissspidy):

 @westonruter Thanks for the screenshots. `wp_list_sort()` right now only
 does a `usort()`, whereas the affected customizer parts sometimes use
 `uasort()`. [38862] reverts an instance of `usort()` as well though. With
 that being said, I'd rather have reverted the ''whole'' commit because of
 the test failures instead.

 The tests are failing because `usort()` / `uasort()` are not stable and
 their behaviour changed from PHP 5 to PHP 7. That makes it basically
 untestable.

 What we definitely need is `wp_list_usort()` and `wp_list_uasort()` or an
 additional parameter to `wp_list_sort()`.

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


More information about the wp-trac mailing list