The question belongs to Wordpress and Advanced Custom Fields.
I have created two post types i.e., 'courses' and 'universities'. In courses, I created a relationship 'related_university' that connects courses to universities. However, I could not filter my courses by relationship values (title or any other field).
the following method works for me when I print the title of the related university:
$result = array(
"id" => get_the_ID(),
"title" => get_the_title(),
"rel_university_name" => get_field("related_university")->post_title,
However, I get no results when I use the same method to filter my posts by the title:
$args['meta_query'] = array(
'key' => get_field('related_university')->post_title,
'value' => $related_university_title,
'compare' => 'LIKE'