Is it possible to get_terms by author?

I get terms from all my posts with get_terms,

$tags = get_terms( 'mytags', '&number=5&orderby=date&order=desc&hide_empty=1' );
foreach ( $tags as $tag ) {
    echo '<a href="'.get_bloginfo('url').'/tags/'.$tag->slug.'">'.$tag->name.'</a>';
}

Is it possible to get_terms included to the posts made by author?
I try to add a list with all the terms (tags) in author.php template,

Read More

thanks a lot!

Related posts

Leave a Reply

1 comment

  1. Not directly, because terms are assigned to posts, not authors.

    You will need to query all posts, get their terms and authors, and then filter out terms which came with posts that have other authors than get_query_var('author').

    Note that depending on the number of posts your site has, this kind of query could be very expensive. A better way would be to either record term IDs inside an user meta key during save_post (still kind of slow), or create your own table with the data you need (fast).