Conversation
|
Size Change: +461 B (+0.02%) Total Size: 2.58 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @michiecat, @retnonindya, @franckmee, @jschramm-ta, @magnuskson, @frspp. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Oh that's nice, this'll be a welcome feature for query loop fans. I wonder if "Include/Exclude: [term]" is the right vernacular. It probably is, but is there a different simpler terminology we can use? Perhaps to start we could delete "Include": any filter that specifies a term is implied to be filtering to that term. So perhaps it's enough to keep every existing filter intact, but then only prefix "Exclude" on the omissions. Does that make sense? |
|
Flaky tests detected in 998ecb4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20195538505
|
4b075b3 to
b8e5fcf
Compare
mcsf
left a comment
There was a problem hiding this comment.
Most of my comments are nit-picks which you are free to dismiss. Some of them stem just from overthinking, and some others have long-term readability in mind.
A couple of comments are more pertinent: the one on oppositeTermIds, and considering preparing backports.
packages/block-library/src/query/edit/inspector-controls/taxonomy-controls.js
Outdated
Show resolved
Hide resolved
| <TaxonomyItem | ||
| taxonomy={ taxonomy } | ||
| termIds={ includeTermIds } | ||
| oppositeTermIds={ excludeTermIds } |
There was a problem hiding this comment.
oppositeTermIds is a clever addition, but keep in mind that it could backfire in edge cases where users are changing these filters (from excl to incl or vice versa) by first adding in one field and then removing in the other.
Ultimately, it's your call. :)
It could also be something explored later, including alternatives like using in-place validation to warn users if they have the same term in both inputs at the same time.
There was a problem hiding this comment.
Yeah, I'd lean on leaving it as is for now and see if there is any feedback in the future. Personally I thought it's better to do that, because adding a term in both include and exclude will return nothing, that could be confusing too.
3077fe2 to
998ecb4
Compare
998ecb4 to
2b7705b
Compare
What?
Resolves: #53485
This PR adds support to exclude specific terms. The current approach is preserving the same filter (
Filters->Taxonomies), by adding two inputs for each taxonomy, one forincludeand another forexclude. I've updated the labels to[Taxonomy]andexclude: [Taxonomy], and render them sequentially for each taxonomy (see screenshot below). This might need design feedback (@WordPress/gutenberg-design ).Combination of taxonomy filters are same as before with a logical
AND.The
taxQueryattribute now supports both inclusion and exclusion of taxonomy terms. The structure looks like this:This essentially adds a deprecation in Query Loop block.
Testing Instructions
Query typetoCustom.Testing for migrating Query Loop block
customQuery Loop block and apply some taxonomy filters before testing this PR.taxQuerystructure.Screenshots or screencast