Make WordPress Core


Ignore:
Timestamp:
09/05/2013 11:31:28 PM (11 years ago)
Author:
wonderboymusic
Message:

Move get_meta_type() into the WP_Meta_Query class as get_cast_for_type(). WP_Query can then access it like: $this->meta_query->get_cast_for_type().

See #21621, [25255].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r25255 r25269  
    24222422                    case 'meta_value':
    24232423                        if ( isset( $q['meta_type'] ) ) {
    2424                             $meta_type = get_meta_type( $q['meta_type'] );
     2424                            $meta_type = $this->meta_query->get_cast_for_type( $q['meta_type'] );
    24252425                            $orderby = "CAST($wpdb->postmeta.meta_value AS {$meta_type})";
    24262426                        } else {
    24272427                            $orderby = "$wpdb->postmeta.meta_value";
    2428                         }   
     2428                        }
    24292429                        break;
    24302430                    case 'meta_value_num':
Note: See TracChangeset for help on using the changeset viewer.