From 3e679aec09e1587634dd6ddee663177814708aa7 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Mon, 5 Feb 2024 15:56:01 +0100 Subject: [PATCH] Avoid duplicates --- includes/class-user-query.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/class-user-query.php b/includes/class-user-query.php index abc11cd6..2ca6b22a 100644 --- a/includes/class-user-query.php +++ b/includes/class-user-query.php @@ -139,8 +139,10 @@ public function add_virtual_subscriptions( $args = array() ) { ); foreach ( $term_query->get_terms() as $term ) { - $this->results[ $term->term_id ] = new Subscription( $term ); - $this->total_users += 1; + if ( ! isset( $this->results[ $term->term_id ] ) ) { + $this->results[ $term->term_id ] = new Subscription( $term ); + $this->total_users += 1; + } } } }