I contacted Scribu because his Query Multiple Taxonomies plugin did what I was looking to do and he pointed me in the right direction. I’ve got this working (in my dev environment) so I think this is it. (Scribu had these split into two functions as part of a class – I’m sure that’s the “classy” (pun unintended) way to do it – but this works inline: (Posting here in case it helps anyone else…)
//building this as if we were going to look for
//posts that have been categorized with this service
$tempargs = array('post_type' => 'vendors',
'tax_query' => array(array(
'taxonomy' => 'service',
'field' => 'id',
'terms' => intval($_GET['srv'])
))
);
$args = array_merge( $tempargs, array(
'fields' => 'ids',
'nopaging' => true,
'no_found_rows' => true,
'ignore_sticky_post' => true,
'cache_results' => false,
) );
$query = new WP_Query;
$filtered_ids = $query->query( $args );
//now getting the list of location terms that have posts in this service
$locationsWdups = wp_get_object_terms( $filtered_ids, 'location' );
//the above will include duplicate locations so we'll combine them
//into one array below
$locations = array();
foreach ( $locationsWdups as $singloc )
$locations[ $singloc->term_id ] = $singloc;
Then you can do a foreach on $locations…
(Please correct me if I’ve missed something or am doing something incorrectly)