Get authors who has posts in category - WordPress
$barcelona_posts = get_posts('cat=59');
$barcelona_author_ids = array();
foreach ( $barcelona_posts as $k => $v ) {
if ( ! in_array( $v->post_author, $barcelona_author_ids ) ) {
$barcelona_author_ids[] = $v->post_author;
}
}
$barcelona_authors = get_users( array(
'fields' => 'ID',
'who' => 'authors',
'order' => 'DESC',
'orderby'=> 'post_count',
'include' => $barcelona_author_ids
) );