Starting from this example
https://www.advancedcustomfields.com/resources/querying-relationship-fields/
If doctors had taxonomies as I could from location find all the taxonomies of the doctors who has relationship
This should work and do what I want, but it does not work. Someone to help ?? I do not know where I’m going wrong.
$args = array(
'taxonomy' => 'custom_taxonomy',
'orderby' => 'name',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'my_custom_field', // name of custom field
'value' => "{$post_id}", // matches exactly "123", not just 123. This prevents a match for "1234"
'compare' => 'LIKE'
)
);
$atv = get_terms($args);
var_dump($atv)