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

Add tests for WooCommerce #3259

Merged
merged 21 commits into from
Feb 24, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adjust feedback
  • Loading branch information
burhandodhy committed Feb 15, 2023
commit b94741db0917f00574f5019354bab35aa1523eae
8 changes: 4 additions & 4 deletions includes/classes/Feature/WooCommerce/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ public function translate_args( $query ) {
'product_variation',
);

if ( $query->is_post_type_archive( 'product' ) || isset( $query->query_vars['ep_integrate'] ) && filter_var( $query->query_vars['ep_integrate'], FILTER_VALIDATE_BOOLEAN ) ) {
$supported_post_types[] = 'product';
}

/**
* Expands or contracts the post_types eligible for indexing.
*
Expand All @@ -299,10 +303,6 @@ public function translate_args( $query ) {
*/
$supported_post_types = apply_filters( 'ep_woocommerce_default_supported_post_types', $post_types );

if ( $query->is_post_type_archive( 'product' ) || isset( $query->query_vars['ep_integrate'] ) && filter_var( $query->query_vars['ep_integrate'], FILTER_VALIDATE_BOOLEAN ) ) {
$supported_post_types[] = 'product';
}

$supported_post_types = array_intersect(
$supported_post_types,
Indexables::factory()->get( 'post' )->get_indexable_post_types()
Expand Down