備忘録です。
ユーザーとカスタムタクソノミーを紐付けるのには「LH User Taxonomies」を利用しています。
これで紐付けたカスタムタクソノミーをユーザーIDを指定して取得する方法です。
ex.areaというカスタムタクソノミーをユーザーと紐付けている場合。
$product_terms = wp_get_object_terms( $user_id, 'area' );
if ( ! empty( $product_terms ) ) {
if ( ! is_wp_error( $product_terms ) ) {
foreach( $product_terms as $term ) {
echo $term->slug;
}
}
}


