Changeset 29650 for trunk/src/wp-includes/meta.php
- Timestamp:
- 08/27/2014 08:22:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r29421 r29650 1012 1012 } 1013 1013 1014 $where_meta_key = array();1015 1014 foreach ( $queries as $k => $q ) { 1016 1015 $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : ''; … … 1055 1054 1056 1055 $where[$k] = ''; 1057 if ( ! empty( $meta_key ) ) { 1058 if ( isset( $q['compare'] ) ) { 1059 $where_meta_key[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); 1060 } else { 1061 $where[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); 1062 } 1063 } 1056 if ( !empty( $meta_key ) ) 1057 $where[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); 1064 1058 1065 1059 if ( is_null( $meta_value ) ) { 1066 if ( empty( $where[$k] ) && empty( $where_meta_key ) ) {1060 if ( empty( $where[$k] ) ) 1067 1061 unset( $join[$i] ); 1068 }1069 1062 continue; 1070 1063 } … … 1106 1099 else 1107 1100 $where = ' AND (' . implode( "\n{$this->relation} ", $where ) . ' )'; 1108 1109 if ( ! empty( $where_meta_key ) ) {1110 $where .= "\nAND (" . implode( "\nAND ", $where_meta_key ) . ' )';1111 }1112 1101 1113 1102 $join = implode( "\n", $join );
Note: See TracChangeset
for help on using the changeset viewer.