Skip to content

Determining main query from pre_get_terms #13

@ssnepenthe

Description

@ssnepenthe

Currently it is possible to hook in at pre_get_terms to modify the query args before query is actually run, but there is no good way to guarantee that the query instance is part of the terms archive.

You can check is_terms_archive(), but it is always possible that there are other term queries being run on the same page.

Core has is_main_query( $query ) and $query->is_main_query() for WP_Query...

Maybe there could be some helpers like is_term_query(), is_main_term_query() and is_term_count_query()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions