Changeset 28659 for trunk/src/wp-includes/meta.php
- Timestamp:
- 06/04/2014 05:47:19 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r28522 r28659 973 973 } 974 974 975 $where_meta_key = array(); 975 976 foreach ( $queries as $k => $q ) { 976 977 $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : ''; … … 1015 1016 1016 1017 $where[$k] = ''; 1017 if ( !empty( $meta_key ) ) 1018 $where[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); 1018 if ( ! empty( $meta_key ) ) { 1019 if ( isset( $q['compare'] ) ) { 1020 $where_meta_key[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); 1021 } else { 1022 $where[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); 1023 } 1024 } 1019 1025 1020 1026 if ( is_null( $meta_value ) ) { 1021 if ( empty( $where[$k] ) )1027 if ( empty( $where[$k] ) && empty( $where_meta_key ) ) { 1022 1028 unset( $join[$i] ); 1029 } 1023 1030 continue; 1024 1031 } … … 1060 1067 else 1061 1068 $where = ' AND (' . implode( "\n{$this->relation} ", $where ) . ' )'; 1069 1070 if ( ! empty( $where_meta_key ) ) { 1071 $where .= "\nAND " . implode( "\nAND ", $where_meta_key ); 1072 } 1062 1073 1063 1074 $join = implode( "\n", $join );
Note: See TracChangeset
for help on using the changeset viewer.