title: Query a custom post type by another custom post type value linked to it by an ACF relationship field
body: <p>I want to query a Custom post type <strong>Person</strong>, filter those people by their first name and the name of the <strong>City</strong> they are living in.</p>
  
  <p>But I don't know the <strong>ID</strong> of the <strong>City</strong> but only it's name.</p>
  
  <p>The <strong>City</strong> is in my case another custom post type, linked to the <strong>Person</strong> with an ACF relationship field.</p>
  
  <p>I'm using the Wordpress JSON API V2 to search people with filters, I used the <strong>add_meta_query_to_rest_query</strong> hook to filter my custom post type <strong>Person</strong>, if I add a simple filter it works :</p>
  
  <pre class="lang-php prettyprint-override"><code>$args['meta_query'][] = array(
      'key' =&gt; 'firstname',
      'value' =&gt; 'John',
      'compare' =&gt; '='
  );
  </code></pre>
  
  <p>But if I want to filter the persons living in <strong>Paris</strong> (which is a meta of the linked Custom post Type), I can't find the right syntax to do it.
  I tried to use <em>city_name</em> key.</p>
  
  <pre class="lang-php prettyprint-override"><code>$args['meta_query'][] = array(
      'key' =&gt; 'city_name',
      'value' =&gt; 'Paris',
      'compare' =&gt; '='
  );
  </code></pre>
  
  <p>Here is the only working way I found for now, with the ID : </p>
  
  <pre class="lang-php prettyprint-override"><code>$args['meta_query'][] = array(
      'key' =&gt; 'city',
      'value' =&gt; '"10"',
      'compare' =&gt; 'LIKE'
  );
  </code></pre>
  
  <p>Thanks</p>