WordPress.org

Make WordPress Core

Changeset 15570


Ignore:
Timestamp:
09/05/2010 03:30:10 PM (9 years ago)
Author:
scribu
Message:

Fix meta query in WP_User_Query. See #14572

File:
1 edited

Legend:

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

    r15567 r15570  
    462462        }
    463463
    464         $meta_queries[] = array(
    465             'meta_key' => @$qv['meta_key'],
    466             'meta_value' => @$qv['meta_key'],
    467             'meta_compare' => @$qv['meta_key'],
    468         );
     464        $meta_query = array();
     465        foreach ( array( 'meta_key', 'meta_value', 'meta_compare' ) as $key )
     466            if ( isset( $qv[ $key ] ) )
     467                $meta_query[ $key ] = $qv[ $key ];
     468        $meta_queries[] = $meta_query;
    469469
    470470        $meta_query_sql = _wp_meta_sql( $meta_queries, 'user_id', $wpdb->usermeta );
     
    577577    if ( empty($id) )
    578578        $id = (int) $blog_id;
    579    
     579
    580580    return get_users( array( 'blog_id' => $id ) );
    581581}
Note: See TracChangeset for help on using the changeset viewer.