[buddypress-trac] [BuddyPress Trac] #7238: Change bp_sort_by_key() to allow key preservation.

buddypress-trac noreply at wordpress.org
Wed Aug 31 17:28:45 UTC 2016


#7238: Change bp_sort_by_key() to allow key preservation.
-------------------------+-----------------------
 Reporter:  dcavins      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  2.7
Component:  Core         |    Version:  2.2
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------
 `bp_sort_by_key()` internally uses `usort()` which discards keys once the
 sort is completed. I'd like to make it possible to keep the keys when
 helpful.

 In the attached patch, I've added a new parameter to `bp_sort_by_key()`
 that runs the results through `uasort()` instead of `usort()`.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7238>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list