title: Wordpress custom tax query with multiple conditions not working
body: <p>I have this weird functionality that is not working in wordpress.</p>
  
  <p>I'm using woocomerce and I have to get some products based on some filters using the following dump code:</p>
  
  <pre><code>  ["tax_query"]=&gt;
    array(2) {
      [0]=&gt;
      array(4) {
        ["taxonomy"]=&gt;
        string(11) "product_cat"
        ["field"]=&gt;
        string(4) "slug"
        ["terms"]=&gt;
        array(4) {
          [0]=&gt;
          string(3) "running"
          [1]=&gt;
          string(9) "hiking"
        }
        ["operator"]=&gt;
        string(3) "AND"
      }
      [1]=&gt;
      array(4) {
        ["taxonomy"]=&gt;
        string(11) "product_cat"
        ["field"]=&gt;
        string(4) "slug"
        ["terms"]=&gt;
        array(2) {
          [0]=&gt;
          string(5) "nike"
          [1]=&gt;
          string(9) "adidas"
        }
        ["operator"]=&gt;
        string(2) "OR"
      }
    }
  </code></pre>
  
  <p>For <code>$args['tax_query'][0]</code> I need to make <code>AND</code> logic. This means that the results must decrease if I select more checkboxes.</p>
  
  <p>For <code>$args['tax_query'][1]</code> I need to make an <code>OR</code> logic.</p>
  
  <p>The explanation for the above code is: Give me all the products that are for running but also for hiking and is produced by nike or adidas.</p>
  
  <p>The following code returns 0 results. If I remove the <code>["operator"]=&gt; 'AND'</code> from <code>$args['tax_query'][0]</code> it will return all the results like it just pass the filter.</p>
  
  <p>The final code is:</p>
  
  <pre><code>array(6) {
    ["posts_per_page"]=&gt;
    string(2) "12"
    ["post_status"]=&gt;
    string(7) "publish"
    ["post_type"]=&gt;
    string(7) "product"
    ["offset"]=&gt;
    string(1) "0"
    ["tax_query"]=&gt;
    array(2) {
      [0]=&gt;
      array(4) {
        ["taxonomy"]=&gt;
        string(11) "product_cat"
        ["field"]=&gt;
        string(4) "slug"
        ["terms"]=&gt;
        array(3) {
          [0]=&gt;
          string(3) "running"
          [1]=&gt;
          string(9) "hiking"
        }
        ["operator"]=&gt;
        string(3) "AND"
      }
      [1]=&gt;
      array(4) {
        ["taxonomy"]=&gt;
        string(11) "product_cat"
        ["field"]=&gt;
        string(4) "slug"
        ["terms"]=&gt;
        array(2) {
          [0]=&gt;
          string(11) "nike"
          [1]=&gt;
          string(34) "adidas"
        }
        ["operator"]=&gt;
        string(2) "OR"
      }
    }
    ["meta_query"]=&gt;
    NULL
  }
  </code></pre>
  
  <p>Any explanation or a fix for this? </p>
  
  <p>Thank you.</p>