首先抓取作者的帖子ID,然后抓取术语。
$author_id = \'1234\';
$taxonomy = \'clubs\';
$post_ids = get_posts(\'fields=ids&post_type=post&post_status=publish&showposts=-1&author=\'. $author_id );
$clubs = wp_get_object_terms($post_ids, array($taxonomy));
$html = \'<ul>\';
foreach( $clubs as $club )
{
$html .= sprintf(
\'<li><a href="%1$s">%2$s</a></li>\',
get_term_link($club, $taxonomy),
$club->name
);
}
$html .= \'</ul>\';
echo $html;