diff --git a/wp-includes/meta.php b/wp-includes/meta.php
index 22b0315..6419d45 100644
a
|
b
|
class WP_Meta_Query { |
803 | 803 | continue; |
804 | 804 | } |
805 | 805 | } else { |
806 | | $meta_value = trim( $meta_value ); |
| 806 | if ( ! is_array( $meta_value ) ) |
| 807 | $meta_value = trim( $meta_value ); |
807 | 808 | } |
808 | 809 | |
809 | 810 | if ( 'IN' == substr( $meta_compare, -2) ) { |
… |
… |
class WP_Meta_Query { |
812 | 813 | $meta_value = array_slice( $meta_value, 0, 2 ); |
813 | 814 | $meta_compare_string = '%s AND %s'; |
814 | 815 | } elseif ( 'LIKE' == substr( $meta_compare, -4 ) ) { |
815 | | $meta_value = '%' . like_escape( $meta_value ) . '%'; |
| 816 | if ( ! is_array( $meta_value ) ) |
| 817 | $meta_value = '%' . like_escape( $meta_value ) . '%'; |
816 | 818 | $meta_compare_string = '%s'; |
817 | 819 | } else { |
818 | 820 | $meta_compare_string = '%s'; |
… |
… |
class WP_Meta_Query { |
821 | 823 | if ( ! empty( $where[$k] ) ) |
822 | 824 | $where[$k] .= ' AND '; |
823 | 825 | |
824 | | $where[$k] = ' (' . $where[$k] . $wpdb->prepare( "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string})", $meta_value ); |
| 826 | $cast_format = ' (' . $where[$k] . "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string})"; |
| 827 | if ( 'LIKE' == substr( $meta_compare, -4 ) && is_array( $meta_value ) ) { |
| 828 | $like_where = ''; |
| 829 | foreach ( (array) $meta_value as $_meta_value ) |
| 830 | $like_where .= ' OR ' . $wpdb->prepare( $cast_format, '%' . like_escape( $_meta_value ) . '%' ); |
| 831 | |
| 832 | $where[$k] = substr( $like_where, 4 ); |
| 833 | } else { |
| 834 | $where[$k] = $wpdb->prepare( $cast_format, $meta_value ); |
| 835 | } |
825 | 836 | } |
826 | 837 | |
827 | 838 | $where = array_filter( $where ); |