mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Optimize get_tax_sql(). See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16413 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1933,6 +1933,11 @@ class WP_Query {
|
||||
// Taxonomies
|
||||
$q['tax_query'] = $this->parse_tax_query( $q );
|
||||
if ( !empty( $q['tax_query'] ) ) {
|
||||
$clauses = call_user_func_array( 'get_tax_sql', array( $q['tax_query'], $wpdb->posts, 'ID', &$this) );
|
||||
|
||||
$join .= $clauses['join'];
|
||||
$where .= $clauses['where'];
|
||||
|
||||
if ( empty($post_type) ) {
|
||||
$post_type = 'any';
|
||||
$post_status_join = true;
|
||||
@@ -1940,8 +1945,6 @@ class WP_Query {
|
||||
$post_status_join = true;
|
||||
}
|
||||
|
||||
$where .= get_tax_sql( $q['tax_query'], "$wpdb->posts.ID" );
|
||||
|
||||
// Back-compat
|
||||
$tax_query_in = wp_list_filter( $q['tax_query'], array( 'operator' => 'IN' ) );
|
||||
if ( !empty( $tax_query_in ) ) {
|
||||
|
||||
Reference in New Issue
Block a user