Skip to content

Query block taxonomy filter does not work on frontend if taxonomy is not set to publicly_queryable #59257

@eric-michel

Description

@eric-michel

Description

When publicly_queryable is set to false for a custom taxonomy, it can still be selected in the query block filter criteria (and filters properly in the editor) but does not properly filter on the frontend.

Ideally, filtering would remain working even when a taxonomy is set to not be publicly_queryable.

Step-by-step reproduction instructions

  1. Register a custom taxonomy with publicly_queryable set to false, and apply it to a post type.
  2. Add some terms to the taxonomy.
  3. Create some sample posts with a variety of terms selected.
  4. Add a query block to a test page and filter for one of the terms used in your sample posts.

You should notice the list of posts properly filtered in the editor, but once you save the page and view it on the frontend, all posts will appear.

This issue is also described in this comment from over a year ago: #41067 (comment)

Screenshots, screen recording, code snippet

No response

Environment info

  • WP version 6.4.3
  • Twenty Twenty-Four theme
  • Gutenberg plugin 17.7.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

[Block] Query LoopAffects the Query Loop Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions