WordPress.org

Make WordPress Core

Changeset 15624


Ignore:
Timestamp:
09/17/2010 04:08:35 PM (9 years ago)
Author:
scribu
Message:

Allow plugins to manipulate the meta query args. See #14645

File:
1 edited

Legend:

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

    r15613 r15624  
    670670     */
    671671    var $tax_query = array();
     672
     673    /**
     674     * Metadata query
     675     *
     676     * @since 3.1.0
     677     * @access public
     678     * @var array
     679     */
     680    var $meta_query = array();
    672681
    673682    /**
     
    13641373            }
    13651374
     1375            $meta_query = wp_array_slice_assoc( $qv, array( 'meta_key', 'meta_value', 'meta_compare' ) );
     1376            if ( !empty( $meta_query ) )
     1377                $this->meta_query[] = $meta_query;
     1378
    13661379            if ( empty($qv['author']) || ($qv['author'] == '0') ) {
    13671380                $this->is_author = false;
     
    21672180        }
    21682181
    2169         // postmeta queries
    2170         $meta_query = wp_array_slice_assoc( $q, array( 'meta_key', 'meta_value', 'meta_compare' ) );
    2171         list( $meta_join, $meta_where ) = _wp_meta_sql( array( $meta_query ), $wpdb->posts, 'ID', $wpdb->postmeta, 'post_id' );
     2182        list( $meta_join, $meta_where ) = _wp_meta_sql( $this->meta_query, $wpdb->posts, 'ID', $wpdb->postmeta, 'post_id' );
    21722183        $join .= $meta_join;
    21732184        $where .= $meta_where;
Note: See TracChangeset for help on using the changeset viewer.