title: wordpress handle ACF custom fields of type relationship with WP_Query
body: <p>I'm using a WP_Query inside one of my functions.</p>
  
  <pre><code>function get_id_list ($postType) {
      $wpb_all_query = new WP_Query(
          array(
              'post_type' =&gt; $postType,
              'post_status' =&gt; 'publish',
              'posts_per_page' =&gt; -1,
              'meta_query' =&gt; array(
                  array(
                      //'key' =&gt; 'title',
                      //'value' =&gt; 'Wordpress Development BSP Project', // this works and the function only returns a list with the single ID of the post where this matches
                      'key' =&gt; 'bicslab_axis',
                      'value' =&gt; '22', // this does not work
                      'value' =&gt; 'greenware', // this does not work
  
                  )
              )
          )
      );
      $postIDList = [];
      if($wpb_all_query-&gt;have_posts()){
          while ( $wpb_all_query-&gt;have_posts() ) {
              $wpb_all_query-&gt;the_post();
              $postIDList[] = get_the_ID();
          }
          wp_reset_postdata();
      }
      print_r($postIDList);
      return $postIDList;
  }
  </code></pre>
  
  <p>The query works correctly when in the <code>'meta_query'</code> I choose a key which is a field of type "text", but it does not if I choose a field of type "relationship".</p>
  
  <p>Here is a screenshot of my advanced custom fields:
  <a href="https://i.stack.imgur.com/Kg0en.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kg0en.png" alt="enter image description here"></a></p>
  
  <p>For the relationship fields I tried putting the ID and the name, none of them would work.</p>
  
  <p>How would I do it to make the query retrieve only posts where custom field of type relation is related to only some objects?</p>
  
  <p>Edit: I should clarify, I used <code>"22"</code>respectively <code>"greenware"</code> as values in my mea query because 22 is the ID and greenware is the "name" of the specific blog post/object with that id</p>