Changeset 16143
- Timestamp:
- 11/01/2010 08:34:54 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-object-query.php
r16142 r16143 88 88 * Default: 'CHAR' 89 89 * 90 * @param string $meta_type 90 91 * @param string $primary_table 91 92 * @param string $primary_id_column 92 * @param string $meta_table93 * @param string $meta_id_column94 93 * @return array( $join_sql, $where_sql ) 95 94 */ 96 function get_meta_sql( $meta_query, $ primary_table, $primary_id_column, $meta_table, $meta_id_column ) {95 function get_meta_sql( $meta_query, $meta_type, $primary_table, $primary_id_column ) { 97 96 global $wpdb; 97 98 if ( ! $meta_table = _get_meta_table( $meta_type ) ) 99 return false; 100 101 $meta_id_column = esc_sql( $meta_type . '_id' ); 98 102 99 103 $clauses = array(); … … 158 162 } 159 163 160 return apply_filters( 'get_meta_sql', compact( 'join', 'where' ), $meta_query, $ primary_table, $primary_id_column, $meta_table, $meta_id_column );164 return apply_filters( 'get_meta_sql', compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column ); 161 165 } 162 166 -
trunk/wp-includes/query.php
r16116 r16143 2147 2147 2148 2148 if ( !empty( $q['meta_query'] ) ) { 2149 $clauses = $this->get_meta_sql( $q['meta_query'], $wpdb->posts, 'ID', $wpdb->postmeta, 'post_id' );2149 $clauses = $this->get_meta_sql( $q['meta_query'], 'post', $wpdb->posts, 'ID' ); 2150 2150 $join .= $clauses['join']; 2151 2151 $where .= $clauses['where']; -
trunk/wp-includes/user.php
r16053 r16143 469 469 470 470 if ( !empty( $qv['meta_query'] ) ) { 471 $clauses = $this->get_meta_sql( $qv['meta_query'], $wpdb->users, 'ID', $wpdb->usermeta, 'user_id' );471 $clauses = $this->get_meta_sql( $qv['meta_query'], 'user', $wpdb->users, 'ID' ); 472 472 $this->query_from .= $clauses['join']; 473 473 $this->query_where .= $clauses['where'];
Note: See TracChangeset
for help on using the changeset viewer.