From 6107efe572e03c0db8a74b53946667183a52eced Mon Sep 17 00:00:00 2001 From: scribu Date: Mon, 4 Oct 2010 17:51:17 +0000 Subject: [PATCH] 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 --- wp-includes/query.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index c3bc48925..02d5d6043 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1168,8 +1168,6 @@ class WP_Query { , 'tb' , 'paged' , 'comments_popup' - , 'meta_key' - , 'meta_value' , 'preview' , 's' , 'sentence' @@ -1391,7 +1389,12 @@ class WP_Query { $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' ) ); + if ( !empty( $meta_query ) ) $this->meta_query[] = $meta_query; @@ -2984,7 +2987,7 @@ class WP_Query { * * @since 3.1.0 * - * @return bool + * @return bool */ function is_paged() { return (bool) $this->is_paged;