Skip to content

Commit

Permalink
Merge pull request #437 from rebeccahum/dedupe_coauthors_wp_list_authors
Browse files Browse the repository at this point in the history
remove duplicates from linked accounts on coauthors_wp_list_authors()
  • Loading branch information
philipjohn authored Oct 13, 2017
2 parents 39c40dd + 32a4c51 commit ca3fd7b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,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 = '';
Expand Down

0 comments on commit ca3fd7b

Please sign in to comment.