Recognize meta_query as a query var. Props aaroncampbell. Fixes #14645

git-svn-id: http://svn.automattic.com/wordpress/trunk@15713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-10-04 17:51:17 +00:00
parent 7119d7429e
commit 6107efe572
1 changed files with 6 additions and 3 deletions

View File

@ -1168,8 +1168,6 @@ class WP_Query {
, 'tb' , 'tb'
, 'paged' , 'paged'
, 'comments_popup' , 'comments_popup'
, 'meta_key'
, 'meta_value'
, 'preview' , 'preview'
, 's' , 's'
, 'sentence' , 'sentence'
@ -1391,7 +1389,12 @@ class WP_Query {
$this->is_tax = true; $this->is_tax = true;
} }
if ( !empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) {
$this->meta_query = $qv['meta_query'];
}
$meta_query = wp_array_slice_assoc( $qv, array( 'meta_key', 'meta_value', 'meta_compare' ) ); $meta_query = wp_array_slice_assoc( $qv, array( 'meta_key', 'meta_value', 'meta_compare' ) );
if ( !empty( $meta_query ) ) if ( !empty( $meta_query ) )
$this->meta_query[] = $meta_query; $this->meta_query[] = $meta_query;
@ -2984,7 +2987,7 @@ class WP_Query {
* *
* @since 3.1.0 * @since 3.1.0
* *
* @return bool * @return bool
*/ */
function is_paged() { function is_paged() {
return (bool) $this->is_paged; return (bool) $this->is_paged;