How do I get a list of all categories that a given user has written blog posts for?

by Matthew Brown aka Lord Matt   Last Updated June 13, 2019 06:08 AM

I need to retrieve the name of all the categories that a given user has published posts for. If I can also get a URL for the archive of that cat for that user only, this would make me very happy.

How do I get a list of all categories that a given user has written blog posts for (and possibly the URL for that user's cat specific archive)?

What I've got so far:

From what I have learned, I have guessed:

  $args=array();
  $args['taxonomy']='categories';
  $args['hide_empty']=TRUE;
  $args['???']=$user_id;
  $list = get_terms( $args );

or maybe

  $cats = get_categories( 'hide_empty=0' . '???' );

One, both, or neither of these might be what I need. Can anyone help me get this across the finish line?



Related Questions


Updated April 10, 2017 19:08 PM

Updated February 03, 2019 17:08 PM

Updated July 06, 2016 09:03 AM

Updated April 12, 2015 02:03 AM

Updated April 22, 2017 16:08 PM