title: WooCommerce get products by attribute query
body: <p>I have a product with attribute colors.  Attribute values are red, blue and green.  I am trying to create a custom search but I can't get the query to pull any product.</p>
  
  <pre><code>$args =  array(
      'post_type'      =&gt; array('product'),
      'post_status'    =&gt; 'publish',
      'posts_per_page' =&gt; -1,
      'meta_query'     =&gt; array( 
          array(
              'key' =&gt; '_visibility',
              'value' =&gt; array('catalog', 'visible'),
              'compare' =&gt; 'IN',  
          ) 
      ),
      'tax_query'      =&gt; array( 
          array(
              'taxonomy'        =&gt; 'product',
              'field'           =&gt; 'slug',
              'terms'           =&gt;  array('blue', 'red', 'green'),
              'operator'        =&gt; 'IN',
          ),
      )
  );
  
  $products = new WP_Query( $args );
  </code></pre>
  
  <p>Where did I go wrong?</p>