WordPress.org

Make WordPress Core

Changeset 16286


Ignore:
Timestamp:
11/11/2010 10:06:05 AM (8 years ago)
Author:
scribu
Message:

Add context to get_meta_sql(). See #15018

Location:
trunk/wp-includes
Files:
3 edited

Legend:

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

    r16266 r16286  
    370370 * @param string $primary_table
    371371 * @param string $primary_id_column
     372 * @param object $context (optional) The main query object
    372373 * @return array( 'join' => $join_sql, 'where' => $where_sql )
    373374 */
    374 function get_meta_sql( $meta_query, $meta_type, $primary_table, $primary_id_column ) {
     375function get_meta_sql( $meta_query, $meta_type, $primary_table, $primary_id_column, $context = null ) {
    375376    global $wpdb;
    376377
     
    441442    }
    442443
    443     return apply_filters( 'get_meta_sql', compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column );
     444    return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, &$context ) );
    444445}
    445446
  • trunk/wp-includes/query.php

    r16276 r16286  
    21482148
    21492149        if ( !empty( $q['meta_query'] ) ) {
    2150             $clauses = get_meta_sql( $q['meta_query'], 'post', $wpdb->posts, 'ID' );
     2150            $clauses = call_user_func_array( 'get_meta_sql', array( $q['meta_query'], 'post', $wpdb->posts, 'ID', &$this) );
    21512151            $join .= $clauses['join'];
    21522152            $where .= $clauses['where'];
  • trunk/wp-includes/user.php

    r16266 r16286  
    482482
    483483        if ( !empty( $qv['meta_query'] ) ) {
    484             $clauses = get_meta_sql( $qv['meta_query'], 'user', $wpdb->users, 'ID' );
     484            $clauses = call_user_func_array( 'get_meta_sql', array( $qv['meta_query'], 'user', $wpdb->users, 'ID', &$this ) );
    485485            $this->query_from .= $clauses['join'];
    486486            $this->query_where .= $clauses['where'];
Note: See TracChangeset for help on using the changeset viewer.