[wp-trac] [WordPress Trac] #21621: setting meta_type doesn't CAST orderby value

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 26 05:53:56 UTC 2012


#21621: setting meta_type doesn't CAST orderby value
----------------------------+------------------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Query           |     Version:  3.2
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------------------

Comment (by nacin):

 Replying to [comment:4 wonderboymusic]:
 > meta_type already exists:
 >
 > {{{
 > foreach ( array( 'key', 'compare', 'type' ) as $key ) {
 >       if ( !empty( $qv[ "meta_$key" ] ) )
 >               $meta_query[0][ $key ] = $qv[ "meta_$key" ];
 > }
 > }}}

 Ah, interesting. I think that was an unintended side effect. Note how it
 is not specified anywhere else. The meta_query inner arrays take 'key',
 'value', 'compare', and 'type'. When we convert standard query vars (like
 meta_key and meta_value) into a meta_query, we ended up looping over all
 of the possible values for meta_query, rather than the existing standard
 query variables.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21621#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list