Make WordPress Core

Ticket #16829: meta_compare_v2.diff

File meta_compare_v2.diff, 700 bytes (added by ldebrouwer, 14 years ago)

Same patch, just relative to the WP root dir unlike the previous one.

  • wp-includes/meta.php

     
    389389                $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : '';
    390390                $meta_value = isset( $q['value'] ) ? $q['value'] : '';
    391391                $meta_compare = isset( $q['compare'] ) ? strtoupper( $q['compare'] ) : '=';
     392                $meta_compare = ( !isset( $q['compare'] ) && is_array( $meta_value ) ) ? 'IN' : '=';
    392393                $meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR';
    393394
    394395                if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) )