WordPress.org

Make WordPress Core


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

Introduce WP_Object_Query. See #15032

File:
1 edited

Legend:

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

    r15714 r15715  
    331331 * @since 3.1.0
    332332 */
    333 class WP_User_Query {
     333class WP_User_Query extends WP_Object_Query {
    334334
    335335    /**
     
    445445        }
    446446
     447        $this->parse_meta_query( $qv );
     448
    447449        $role = trim( $qv['role'] );
    448450        $blog_id = absint( $qv['blog_id'] );
    449 
    450         $meta_queries = array();
    451451
    452452        if ( $blog_id ) {
     
    459459            }
    460460
    461             $meta_queries[] = $cap_meta_query;
    462         }
    463 
    464         $meta_query = array();
    465         foreach ( array( 'key', 'value', 'compare' ) as $key ) {
    466             if ( !empty( $qv[ "meta_$key" ] ) )
    467                 $meta_query[ $key ] = $qv[ "meta_$key" ];
    468         }
    469 
    470         if ( !empty( $meta_query ) ) {
    471             $meta_queries[] = $meta_query;
    472         }
    473 
    474         list( $meta_join, $meta_where ) = _wp_meta_sql( $meta_queries, $wpdb->users, 'ID', $wpdb->usermeta, 'user_id' );
     461            $this->meta_query[] = $cap_meta_query;
     462        }
     463
     464        list( $meta_join, $meta_where ) = $this->get_meta_sql( $wpdb->users, 'ID', $wpdb->usermeta, 'user_id' );
    475465        $this->query_from .= $meta_join;
    476466        $this->query_where .= $meta_where;
Note: See TracChangeset for help on using the changeset viewer.