Skip to content

Allow filtering of Query Block by publicly non-queryable taxonomies #60301

@eric-michel

Description

@eric-michel

What problem does this address?

I submitted this bug report about taxonomies set to publicaly_queryable = false showing up as a filterable criteria in the block UI, but not actually filtering on the frontend. The bug was fixed in the reverse manner of what I was hoping for here: #59458.

The PR continues to prevent non-queryable taxonomies from being used as filter criteria in the Query Block. This is inconsistent with the way tax_query works as part of WP_Query, which allows for the filtering of posts by non-queryable taxonomies. There are many use-cases for filtering by non-queryable taxonomies, and not a whole lot of reasons I can think of to continue to disallow it.

As things work now, I am using query_loop_block_query_vars to alter the query in the Query Block when necessary. This isn't hard to do, but seems very unnecessary and redundant.

What is your proposed solution?

Allow the use of non-queryable taxonomies in the Query Block filter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions