From fad1f7e59880c20517f748c1a76f0248d5c4c154 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:18:25 -0400 Subject: [PATCH] Avoid PHP warning if get_terms() is called with fields=ids --- classes/PublishPress/Permissions/TermFiltersCount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/PublishPress/Permissions/TermFiltersCount.php b/classes/PublishPress/Permissions/TermFiltersCount.php index 0159e0c6..531ec234 100644 --- a/classes/PublishPress/Permissions/TermFiltersCount.php +++ b/classes/PublishPress/Permissions/TermFiltersCount.php @@ -220,7 +220,7 @@ public function fltGetTerms($terms, $taxonomies, $args) foreach (array_keys($terms) as $k) { foreach (array_keys($all_terms) as $key) { - if (is_object($all_terms[$key])) { + if (is_object($all_terms[$key]) && is_object($terms[$k])) { if ($all_terms[$key]->term_taxonomy_id == $terms[$k]->term_taxonomy_id) { $terms[$k]->count = $all_terms[$key]->count; break;