Make WordPress Core


Ignore:
Timestamp:
11/13/2010 06:32:43 PM (15 years ago)
Author:
scribu
Message:

Kill WP_Object_Query. See #15032

File:
1 edited

Legend:

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

    r16286 r16353  
    445445}
    446446
     447/*
     448 * Populates the $meta_query property
     449 *
     450 * @access private
     451 * @since 3.1.0
     452 *
     453 * @param array $qv The query variables
     454 */
     455function _parse_meta_query( &$qv ) {
     456    $meta_query = array();
     457
     458    // Simple query needs to be first for orderby=meta_value to work correctly
     459    foreach ( array( 'key', 'value', 'compare', 'type' ) as $key ) {
     460        if ( !empty( $qv[ "meta_$key" ] ) )
     461            $meta_query[0][ $key ] = $qv[ "meta_$key" ];
     462    }
     463
     464    if ( !empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) {
     465        $meta_query = array_merge( $meta_query, $qv['meta_query'] );
     466    }
     467
     468    $qv['meta_query'] = $meta_query;
     469}
     470
    447471/**
    448472 * Retrieve the name of the metadata table for the specified object type.
Note: See TracChangeset for help on using the changeset viewer.