From 32a4c51234ebfbaa0d4c0054c4a7364ea4416d19 Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Tue, 4 Jul 2017 13:09:24 -0600 Subject: [PATCH] remove duplicates from linked accounts --- template-tags.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/template-tags.php b/template-tags.php index ffc398ae..e9754619 100644 --- a/template-tags.php +++ b/template-tags.php @@ -473,6 +473,12 @@ function coauthors_wp_list_authors( $args = array() ) { $authors = apply_filters( 'coauthors_wp_list_authors_array', $authors ); + // remove duplicates from linked accounts + $linked_accounts = array_unique( array_column( $authors, 'linked_account' ) ); + foreach ( $linked_accounts as $linked_account ) { + unset( $authors[$linked_account] ); + } + foreach ( (array) $authors as $author ) { $link = '';