You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()?
The text was updated successfully, but these errors were encountered:
Further complicated by the fact that main query and count query are instantiated early (on parse_query) after determining that the current request looks like it is for a terms archive page but before determining that the current request actually is a terms archive page.
This means you can't check Terms_Archive\is_terms_archive() from a pre_get_terms callback...
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()
forWP_Query
...Maybe there could be some helpers like
is_term_query()
,is_main_term_query()
andis_term_count_query()
?The text was updated successfully, but these errors were encountered: