WordPress.org

Make WordPress Core

Ticket #15018: 15018.3.patch

File 15018.3.patch, 1.6 KB (added by sc0ttkclark, 8 years ago)

Standardizing implementation to match get_tax_sql and get_search_sql (implementation in specific location, for access to $this)

  • wp-includes/class.wp-object-query.php

     
    157157                        unset( $meta_compare_string );
    158158                }
    159159
    160                 return apply_filters( 'get_meta_sql', compact( 'join', 'where' ), $meta_query, $primary_table, $primary_id_column, $meta_table, $meta_id_column );
     160                return compact( 'join', 'where' );
    161161        }
    162162
    163163        /*
  • wp-includes/query.php

     
    21472147
    21482148                if ( !empty( $q['meta_query'] ) ) {
    21492149                        $clauses = $this->get_meta_sql( $q['meta_query'], $wpdb->posts, 'ID', $wpdb->postmeta, 'post_id' );
     2150                        $clauses = apply_filters_ref_array('posts_meta_sql', array($clauses, &$this, $q['meta_query'], $wpdb->posts, 'ID', $wpdb->postmeta, 'post_id' ) );
    21502151                        $join .= $clauses['join'];
    21512152                        $where .= $clauses['where'];
    21522153                }
  • wp-includes/user.php

     
    469469
    470470                if ( !empty( $qv['meta_query'] ) ) {
    471471                        $clauses = $this->get_meta_sql( $qv['meta_query'], $wpdb->users, 'ID', $wpdb->usermeta, 'user_id' );
     472                        $clauses = apply_filters_ref_array('users_meta_sql', array($clauses, &$this, $qv['meta_query'], $wpdb->users, 'ID', $wpdb->usermeta, 'user_id' ) );
    472473                        $this->query_from .= $clauses['join'];
    473474                        $this->query_where .= $clauses['where'];
    474475                }