title: WP Query returning results even when $args are not met?
body: <p>In the below WP Query, there seems to be a slightly odd behaviour. When the criteria is met, the correct products are shown, however, if not products match the criteria, other products are shown, rather than having no results? I'm unsure why this might be, but I would assume it is something to do with the <code>tax_query</code> section. In short, what it is trying to retrieve is products from the current tag, that are NOT tagged as featured products (I have another query that targets featured products so this is to avoid duplication).</p>
  <p>How can I ensure no results are shown if the $args are not met?</p>
  <p>Thanks.</p>
  <pre><code>//Get current Tag
  $currentTag = get_term_by('slug', $wp_query-&gt;get_queried_object()-&gt;slug, 'product_tag');
  
  $args = array(
    'post_type' =&gt; 'product',
    'status' =&gt; 'publish',
    'fields' =&gt; 'ids', // Only return IDs
    'orderby' =&gt; 'menu_order',
    'order' =&gt; 'ASC',
    'limit' =&gt; -1,
    'tax_query' =&gt; array(
      'relation' =&gt; 'AND',
      // Only items from current product_cat
      array(
        'taxonomy' =&gt; 'product_tag',
        'field'    =&gt; 'term_id',
        'terms'    =&gt; $currentTag-&gt;term_id,
        'operator' =&gt; 'IN',
      ),
      // AND are not featured
      array(
        'taxonomy' =&gt; 'product_visibility',
        'field'    =&gt; 'name',
        'terms'    =&gt; 'featured',
        'operator' =&gt; 'NOT IN',
      ),
    ),
  );
  $query = new WP_Query( $args );
  </code></pre>
  <p><strong>EDIT:</strong></p>
  <p>After some further research, it seems the problem is coming form another query further down the page. First, I perform 2 WP Queries as per the above, to retrieve different product types, and then merge these into a single array of ID's. Then, I perform the below wc_get_products() query to actually retrieve the product data. As you can see, the <code>include</code> arg states that only the ID's previously queried should be included, but it seems to ignore this when there are no matching products and instead revert to honour the <code>per_page</code> arg. Any way to avoid this and ensure they are excluded? Is there a way to 'exclude' anything that isn't in the <code>$mergedQueries</code>?</p>
  <pre><code>$productsData = wc_get_products(array(
      'include'           =&gt; $mergedQueries,
      'paginate'          =&gt; true,
      'page'              =&gt; $paged,
      'limit'             =&gt; 3,
      'orderby'           =&gt; 'post__in',
      'return'            =&gt; 'objects',
  ));
  </code></pre>