Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSP-1034] fix typo in tax_query #622

Merged
merged 9 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/class-solrpower-wp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ private function parse_tax_query( $tax_query ) {
$multi_query = array();
$multi_query[] = '(' . $field . ':(' . implode( 'OR', $terms ) . '))';
if ( $tax_value['include_children'] && is_taxonomy_hierarchical( $tax_value['taxonomy'] ) ) {
$multi_query[] = '(parent_' . $field . ':' . implode( 'OR', $terms ) . ')';
$multi_query[] = '(parent_' . $field . ':' . implode( 'OR', $terms ) . '))';
jazzsequence marked this conversation as resolved.
Show resolved Hide resolved
}
$query[] = '(' . implode( 'OR', $multi_query ) . ')';
break;
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/wp_query/test-tax-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function test_wp_query_by_tax() {
),
);
$query = new WP_Query( $args );

var_dump( $query->post );
$this->assertEquals( $p_id, $query->post->ID );
}

Expand Down Expand Up @@ -1319,4 +1319,4 @@ public function test_term_taxonomy_id_field_no_taxonomy() {
), $results2, 'Relation: AND; Operator: IN' );
}

}
}
Loading