Taxonomy filter to respect query loop settings - #29
Conversation
|
This is a much needed improvement if this fix works. Hoping Humanmade can review and merge this soon! |
|
Agree! need this! |
|
Triaging the open PRs. Thanks for this @scottpoulin — the underlying goal (term lists that respect the Query Loop's own taxonomy settings) is one we definitely want, and it's closely related to #52. This needs a rebase onto
One thing to watch when you redo it: the diff currently flips if ( empty( $block->context['query']['inherit'] ) ) {back to if ( $block->context['query']['inherit'] ) {which reintroduces the undefined-array-key warning from #15. Also worth reading before you start: #52 covers the closely-related case of term lists that ignore other active filters on the same loop, and #32 adds a "Show Terms in Current Results" option to the same block. There's a real chance all three want to converge on one implementation inside A couple of smaller notes for whenever the rebase happens:
Happy to help if the merge into Generated by Claude Code |
The taxonomy filter pulldown will display all terms from that taxonomy, regardless of whether the parent query loop is using taxonomy filtering or not.
It seems to me that if you're limiting the terms in a query loop, the filter pulldown should be limited to those same terms - otherwise you can select a term that's not in the query loop's result set and get "nothing found."
This branch handles this situation, both for filtering via the standard Gutenberg taxonomy filter and Advance Query Loop's implementation. Note that the latter is only partially supported due to limitations in WP's get_terms function - specifically, only IN and NOT IN operators are supported, and multiple term queries must use the OR relation.