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

WordPress Trac noreply at wordpress.org
Fri Oct 21 11:11:45 UTC 2016


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

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"38859"]:
 {{{
 #!CommitTicketReference repository="" revision="38859"
 General: Introduce a `wp_list_sort()` helper function.

 In addition to `wp_list_filter()` for filtering a list of objects, and
 `wp_list_pluck()` for plucking a certain field out of each object in a
 list, this new function can be used for sorting a list of objects by
 specific fields. These functions are now all contained within the new
 `WP_List_Util()` class and `wp_list_sort()` is used in various parts of
 core for sorting lists.

 Props flixos90, DrewAPicture, jorbin.
 Fixes #37128.
 }}}

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


More information about the wp-trac mailing list