title: Searching using meta_query in wordpress
body: <p>I'm using wordpress to search some content with a few restrictions. Every time I save a post, I save in meta a related posts array. </p>
  
  <p>Then I'm trying to search all posts which has a certain post as related, I have the following query. Selected post is an id to the post I'm looking for. </p>
  
  <p>I checked <code>$selected_post</code> and it has values like the following one. </p>
  
  <pre><code>$selected_post = "25";
  </code></pre>
  
  <p>I added the meta value using the following instruction, I'm using <code>update_post_meta</code>. <code>$related_posts</code> contains an array of post ids, like the example below. </p>
  
  <pre><code>            update_post_meta( $post-&gt;ID, 'related_post', $related_posts );
  </code></pre>
  
  <p><strong>Query</strong></p>
  
  <pre><code>            $arg = array(
                  'post_type'         =&gt; 'post',
                  'posts_per_page'    =&gt; 5,
                  'meta_query'        =&gt; array(
                      'relation'  =&gt; 'OR',
                      array(
                          'key'       =&gt; 'related_post',
                          'value'     =&gt; array( $selected_post ),
                          'compare'   =&gt; 'IN',
                          'type'      =&gt; 'STRING'
                      ),
                  ),
              );
  </code></pre>
  
  <p>I checked this meta in some of my current posts, and I have something like this.</p>
  
  <pre><code>'related_post' =&gt; array( '15', '25', '46' );
  </code></pre>
  
  <p>When I execute this query using <code>WP_Query</code> it always returns me an empty array. I think I need something more in the query to make this works. </p>
  
  <p>Any help would be appreciated. </p>