Skip to content

Selected Flag Doesn't Work Properly with More Than One Selected Term #150

@kevinfodness

Description

@kevinfodness

get_facet_data relies on get_query_var, which in turn relies on $wp_query->tax_query->queried_terms, which for backward compatibility reasons only stores the first queried term for each taxonomy. This means that the selected flag for facet terms will only ever be accurate for the first selected term within a taxonomy.

In order to fix this, we need to build a list of queried terms per taxonomy ourselves directly from $wp_query->tax_query->queries and use that instead of get_query_var.

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