title: Custom Taxonomy and tax_query Issue?
body: <p>I am working on Plugin development and my plugin name is <code>plugindev</code>.I have a custom post type called <code>team</code>.I have a custom taxonomy <code>Team_Category</code> which is being registered by this code</p>
  
  <pre><code>/***************************taxonomy****************************/
  add_action( 'init', 'create_team_taxonomies', 0 );
  function create_team_taxonomies() {
      // Add new taxonomy, make it hierarchical (like categories)
      $labels = array(
          'name'              =&gt; _x( 'Team_Categories', 'taxonomy general name' ),
          'singular_name'     =&gt; _x( 'Team_Category', 'taxonomy singular name' ),
          'search_items'      =&gt; __( 'Search Team_Categories' ),
          'all_items'         =&gt; __( 'All Team_Categories' ),
          'parent_item'       =&gt; __( 'Parent Team_Category' ),
          'parent_item_colon' =&gt; __( 'Parent Team_Category:' ),
          'edit_item'         =&gt; __( 'Edit Team_Category' ),
          'update_item'       =&gt; __( 'Update Team_Category' ),
          'add_new_item'      =&gt; __( 'Add New Team_Category' ),
          'new_item_name'     =&gt; __( 'New Team_Category Name' ),
          'menu_name'         =&gt; __( 'Team_Category' ),
      );
  
      $args = array(
          'hierarchical'      =&gt; true,
          'labels'            =&gt; $labels,
          'show_ui'           =&gt; true,
          'show_admin_column' =&gt; false,
          'query_var'         =&gt; true,
          'rewrite'           =&gt; array( 'slug' =&gt; 'Team_Category' ),
      );
  
      register_taxonomy( 'Team_Category', array( 'team' ), $args );
  }
  /****************************taxanomy end***********************************/
  </code></pre>
  
  <p>But when I use a tax_query in my WP_Query, I do  not get any  posts.
  here is my code</p>
  
  <pre><code>&lt;?php
  $taxonomy_name = 'Team_Category';
  $get_categories = get_terms($taxonomy_name);
  $total_categories = count($get_categories);
  // Loop through the obituaries:
  for ($i = 0; $i &lt; $total_categories; $i++) {
      ?&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-4"&gt;
              &lt;?php echo $category_name = $get_categories[$i]-&gt;name; ?&gt;
          &lt;/div&gt;
          &lt;?php
          $args = array(
              'post_type' =&gt; 'team',
              'tax_query' =&gt; array(
                  array(
                      'taxonomy' =&gt; 'Team_Category', 
                      'field' =&gt; 'slug', 'terms' =&gt; $category_name,)
                  )
           );
  
          $query = new WP_Query($args);
  
          if ($query-&gt;have_posts()) {
          while ($query-&gt;have_posts()) {
              $query-&gt;the_post();
              the_title();
          }
          }
          wp_reset_query(); ?&gt;
  
      &lt;/div&gt;
  
  &lt;?php }
  </code></pre>
  
  <p>It works perfectly without <code>tax_query</code>.I did lot of google but found no suitable result.Any solution to solve this problem .Any help would be highly  appreciated</p>