[wp-trac] [WordPress Trac] #27887: Add orderby meta_value_num option for WP_User_Query

WordPress Trac noreply at wordpress.org
Fri Apr 18 08:30:07 UTC 2014


#27887: Add orderby meta_value_num option for WP_User_Query
-------------------------+-----------------------------
 Reporter:  genkisan     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Users        |    Version:  3.9
 Severity:  normal       |   Keywords:
  Focuses:  template     |
-------------------------+-----------------------------
 Using ''''orderby' => 'meta_value'''', "''sorting will be alphabetical
 which is fine for strings (i.e. words), but can be unexpected for numbers
 (e.g. 1, 3, 34, 4, 56, 6, etc, rather than 1, 3, 4, 6, 34, 56 as you might
 naturally expect). Use 'meta_value_num' instead for numeric values.''"
 (lifted from [http://codex.wordpress.org/Class_Reference/WP_Query
 WP_Query]).

 So as with WP_Query, the '''meta_value_num''' option is needed in
 WP_User_Query for proper numeric sorting.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27887>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list