Changeset 15730 for trunk/wp-includes/classes.php
- Timestamp:
- 10/05/2010 11:06:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r15726 r15730 553 553 */ 554 554 function parse_meta_query( $qv ) { 555 if ( ! empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) {555 if ( ! empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) { 556 556 $this->meta_query = $qv['meta_query']; 557 557 } 558 558 559 559 $meta_query = array(); 560 foreach ( array( 'key', 'value', 'compare' ) as $key ) {561 if ( ! empty( $qv[ "meta_$key" ] ) )560 foreach ( array( 'key', 'value', 'compare', 'type' ) as $key ) { 561 if ( ! empty( $qv[ "meta_$key" ] ) ) 562 562 $meta_query[ $key ] = $qv[ "meta_$key" ]; 563 563 } 564 564 565 if ( ! empty( $meta_query ) ) {565 if ( ! empty( $meta_query ) ) { 566 566 array_unshift( $this->meta_query, $meta_query ); 567 567 } … … 594 594 $meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR'; 595 595 596 if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'IN', 'BETWEEN' ) ) )596 if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'IN', 'BETWEEN' ) ) ) 597 597 $meta_compare = '='; 598 598 599 if ( 'STRING' == $meta_type ) 600 $meta_type = 'CHAR'; 601 elseif ( 'NUMERIC' == $meta_type ) 599 if ( 'NUMERIC' == $meta_type ) 602 600 $meta_type = 'SIGNED'; 603 elseif ( ! in_array( $meta_type, array( 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED' ) ) )601 elseif ( ! in_array( $meta_type, array( 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED' ) ) ) 604 602 $meta_type = 'CHAR'; 605 603 … … 619 617 620 618 if ( in_array( $meta_compare, array( 'IN', 'BETWEEN' ) ) ) { 621 if ( ! is_array( $meta_value ) )619 if ( ! is_array( $meta_value ) ) 622 620 $meta_value = preg_split( '/[,\s]+/', $meta_value ); 623 621 } else {
Note: See TracChangeset
for help on using the changeset viewer.