diff --git src/wp-includes/meta.php src/wp-includes/meta.php
index 55beadb..10436ae 100644
|
|
class WP_Meta_Query { |
770 | 770 | $where["key-only-$key"] = $wpdb->prepare( "$meta_table.meta_key = %s", trim( $q['key'] ) ); |
771 | 771 | } |
772 | 772 | |
| 773 | $where_meta_key = array(); |
773 | 774 | foreach ( $queries as $k => $q ) { |
774 | 775 | $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : ''; |
775 | 776 | $meta_type = $this->get_cast_for_type( isset( $q['type'] ) ? $q['type'] : '' ); |
… |
… |
class WP_Meta_Query { |
813 | 814 | |
814 | 815 | $where[$k] = ''; |
815 | 816 | if ( !empty( $meta_key ) ) |
816 | | $where[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); |
| 817 | $where_meta_key[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); |
817 | 818 | |
818 | 819 | if ( is_null( $meta_value ) ) { |
819 | 820 | if ( empty( $where[$k] ) ) |
… |
… |
class WP_Meta_Query { |
858 | 859 | else |
859 | 860 | $where = ' AND (' . implode( "\n{$this->relation} ", $where ) . ' )'; |
860 | 861 | |
| 862 | if ( !empty($where_meta_key) ) { |
| 863 | $where .= "\nAND " . implode( "\nAND ", $where_meta_key ); |
| 864 | } |
| 865 | |
861 | 866 | $join = implode( "\n", $join ); |
862 | 867 | if ( ! empty( $join ) ) |
863 | 868 | $join = ' ' . $join; |