Strip redundant 'meta_' from 'meta_query' keys. See #14645

git-svn-id: https://develop.svn.wordpress.org/trunk@15714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-10-04 18:26:26 +00:00
parent 68f22e028e
commit ec8503802e
3 changed files with 22 additions and 9 deletions
+7 -2
View File
@@ -1393,10 +1393,15 @@ class WP_Query {
$this->meta_query = $qv['meta_query'];
}
$meta_query = wp_array_slice_assoc( $qv, array( 'meta_key', 'meta_value', 'meta_compare' ) );
$meta_query = array();
foreach ( array( 'key', 'value', 'compare' ) as $key ) {
if ( !empty( $qv[ "meta_$key" ] ) )
$meta_query[ $key ] = $qv[ "meta_$key" ];
}
if ( !empty( $meta_query ) )
if ( !empty( $meta_query ) ) {
$this->meta_query[] = $meta_query;
}
if ( empty($qv['author']) || ($qv['author'] == '0') ) {
$this->is_author = false;