I have created a taxonomy called "user_category"
I am able to obtain the id of the term from the current logged in user -
$current_user = wp_get_current_user(); $terms = get_the_terms($current_user->ID, 'user_category' );
With the id for this term, I then want to find all other users that have this same term id.
I have the following, however this does not work, it will return a post -
$args = array( 'tax_query' => array( array( 'taxonomy' => 'user_category', 'field' => 'term_id', 'terms' => 2 // This being the id ) ) ); $postslist = get_posts( $args );
Can someone help point me in the right direction?