Skip to content

Commit

Permalink
Avoid duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Feb 5, 2024
1 parent 80ef9e5 commit 3e679ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/class-user-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down

0 comments on commit 3e679ae

Please sign in to comment.