WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2010 06:26:26 PM (10 years ago)
Author:
scribu
Message:

Strip redundant 'meta_' from 'meta_query' keys. See #14645

File:
1 edited

Legend:

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

    r15713 r15714  
    13941394            }
    13951395
    1396             $meta_query = wp_array_slice_assoc( $qv, array( 'meta_key', 'meta_value', 'meta_compare' ) );
    1397 
    1398             if ( !empty( $meta_query ) )
     1396            $meta_query = array();
     1397            foreach ( array( 'key', 'value', 'compare' ) as $key ) {
     1398                if ( !empty( $qv[ "meta_$key" ] ) )
     1399                    $meta_query[ $key ] = $qv[ "meta_$key" ];
     1400            }
     1401
     1402            if ( !empty( $meta_query ) ) {
    13991403                $this->meta_query[] = $meta_query;
     1404            }
    14001405
    14011406            if ( empty($qv['author']) || ($qv['author'] == '0') ) {
Note: See TracChangeset for help on using the changeset viewer.