If you use category__in on a search query, is_category() will return true even though is_search() also returns true. This causes a log warning in PHP 8,
[04-Nov-2022 18:45:19 UTC] PHP Warning: Attempt to read property "taxonomy" on null in /usr/src/app/vendor/altis/aws-analytics/inc/namespace.php on line 163
[04-Nov-2022 18:45:19 UTC] PHP Warning: Attempt to read property "slug" on null in /usr/src/app/vendor/altis/aws-analytics/inc/namespace.php on line 164
If we alter the check to only add taxonomy parameters if on a non-search-results page, the queried object will have the expected properties.
If you use category__in on a search query,
is_category()
will returntrue
even thoughis_search()
also returnstrue
. This causes a log warning in PHP 8,If we alter the check to only add taxonomy parameters if on a non-search-results page, the queried object will have the expected properties.
An alternative solution would be to add
to the condition chain.