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

WordPress Trac noreply at wordpress.org
Fri Apr 18 12:43: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                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:  template
-----------------------------------------+------------------------------
Changes (by jdgrimes):

 * keywords:   => has-patch reporter-feedback


Comment:

 Doesn't setting `'type' => 'UNSIGNED'` for a meta field cause it's values
 to be cast to `UNSIGNED`? Does that not work when using `'orderby' =>
 'meta_value'`?

 E.g.:

 {{{

 $query = new WP_User_Query(
       array(
             'meta_query' => array( array( 'key' => 'my_key', 'type' =>
 'UNSIGNED' ) ),
             'orderby' => 'meta_value',
       )
 );
 }}}

 (I haven't taking the time to test this yet, so I could be wrong.)

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


More information about the wp-trac mailing list