mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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]. git-svn-id: https://develop.svn.wordpress.org/trunk@25269 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2421,11 +2421,11 @@ class WP_Query {
|
||||
case $q['meta_key']:
|
||||
case 'meta_value':
|
||||
if ( isset( $q['meta_type'] ) ) {
|
||||
$meta_type = get_meta_type( $q['meta_type'] );
|
||||
$meta_type = $this->meta_query->get_cast_for_type( $q['meta_type'] );
|
||||
$orderby = "CAST($wpdb->postmeta.meta_value AS {$meta_type})";
|
||||
} else {
|
||||
$orderby = "$wpdb->postmeta.meta_value";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'meta_value_num':
|
||||
$orderby = "$wpdb->postmeta.meta_value+0";
|
||||
|
||||
Reference in New Issue
Block a user