Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Enhancement: Changing tax_query field to term_id #6585

Merged
merged 4 commits into from
Jun 22, 2022

Conversation

ovidiul
Copy link
Contributor

@ovidiul ovidiul commented Jun 16, 2022

This PR changes the field from the tax_query defined in ProductTag class, so it's compatible with the core definition of WP_Query taxonomy parameters.

The field possible values are term_id, name, slug or term_taxonomy_id. The default value is term_id.

Fixes #6584

Testing

  1. Create a page and add a Products by Tag block.
  2. Check that is rendered correctly in the editor.
  3. Save the page and check that is rendered correctly in the frontend.

Performance Impact

Should be none, since the query already defaults to term_id by default

Changelog

Enhancement: Replace the ProductTag tax_query field to be the term_id instead of the id.

@ovidiul ovidiul marked this pull request as ready for review June 16, 2022 17:28
@albarin albarin added type: enhancement The issue is a request for an enhancement. type: refactor The issue/PR is related to refactoring. focus: blocks Specific work involving or impacting how blocks behave. block: products by tag Issues related to the Products by Tag block. labels Jun 22, 2022
@albarin albarin merged commit e491d1d into woocommerce:trunk Jun 22, 2022
@nielslange nielslange added this to the 8.0.0 milestone Jul 4, 2022
@nielslange nielslange changed the title changing tax_query field to term_id Enhancement: Changing tax_query field to term_id Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: products by tag Issues related to the Products by Tag block. focus: blocks Specific work involving or impacting how blocks behave. type: enhancement The issue is a request for an enhancement. type: refactor The issue/PR is related to refactoring.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ProductTag wrong taxonomy field id in query arguments
3 participants