WordPress.org

Make WordPress Core

Changeset 16410


Ignore:
Timestamp:
11/17/2010 12:27:34 AM (10 years ago)
Author:
scribu
Message:

Minor get_meta_sql() cleanup. See #9124

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/meta.php

    r16353 r16410  
    381381    $meta_id_column = esc_sql( $meta_type . '_id' );
    382382
    383     $clauses = array();
    384 
    385383    $join = '';
    386384    $where = '';
     
    425423
    426424        if ( 'IN' == substr( $meta_compare, -2) ) {
    427             $meta_field_types = substr( str_repeat( ',%s', count( $meta_value ) ), 1 );
    428             $meta_compare_string = "($meta_field_types)";
    429             unset( $meta_field_types );
     425            $meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')';
    430426        } elseif ( 'BETWEEN' == substr( $meta_compare, -7) ) {
    431427            $meta_value = array_slice( $meta_value, 0, 2 );
     
    438434        }
    439435        $where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value );
    440 
    441         unset( $meta_compare_string );
    442436    }
    443437
Note: See TracChangeset for help on using the changeset viewer.