WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/09/2010 12:18:52 PM (9 years ago)
Author:
scribu
Message:

Fix warning caused by empty meta query. See #14645

File:
1 edited

Legend:

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

    r15766 r15768  
    462462        }
    463463
    464         list( $meta_join, $meta_where ) = $this->get_meta_sql( $qv['meta_query'], $wpdb->users, 'ID', $wpdb->usermeta, 'user_id' );
    465         $this->query_from .= $meta_join;
    466         $this->query_where .= $meta_where;
    467 
    468         if ( !empty($qv['include']) ) {
     464        if ( !empty( $qv['meta_query'] ) ) {
     465            list( $meta_join, $meta_where ) = $this->get_meta_sql( $qv['meta_query'], $wpdb->users, 'ID', $wpdb->usermeta, 'user_id' );
     466            $this->query_from .= $meta_join;
     467            $this->query_where .= $meta_where;
     468        }
     469
     470        if ( !empty( $qv['include'] ) ) {
    469471            $ids = implode( ',', wp_parse_id_list( $qv['include'] ) );
    470472            $this->query_where .= " AND $wpdb->users.ID IN ($ids)";
Note: See TracChangeset for help on using the changeset viewer.