diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 767e09e625..e1d0652214 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -1331,18 +1331,12 @@ class WP_Meta_Query { $join .= " LEFT JOIN $this->meta_table"; $join .= $i ? " AS $alias" : ''; $join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] ); - $sql_chunks['join'][] = $join; // All other JOIN clauses. } else { - $alias = $this->find_compatible_table_alias( $clause, $parent_query ); - if ( false === $alias ) { - $alias = $i ? 'mt' . $i : $this->meta_table; - - $join .= " INNER JOIN $this->meta_table"; - $join .= $i ? " AS $alias" : ''; - $join .= " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column )"; - } + $join .= " INNER JOIN $this->meta_table"; + $join .= $i ? " AS $alias" : ''; + $join .= " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column )"; } $this->table_aliases[] = $alias; @@ -1469,6 +1463,16 @@ class WP_Meta_Query { } } + /** + * Filter the table alias identified as compatible with the current clause. + * + * @since 4.1.0 + * + * @param string|bool $alias Table alias, or false if none was found. + * @param array $clause First-order query clause. + * @param array $parent_query Parent of $clause. + * @param object $this WP_Meta_Query object. + */ return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this ) ; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index b4389c245c..cb970f54a5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-20141017'; +$wp_version = '4.1-alpha-20141018'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.