title: Wordpress category__not_in not working when argument as a variable
body: <p>This is my category.php. I want to filter some posts from this category. Posts were posted in parent and child categories. Show only posts from this category and not from child categries. "category__not_in" not working when argument given as variable. If I use 
  <code>'category__not_in'=&gt; array(20,22,23,24)</code> like this it works perfectly.. In below code     <code>'category__not_in'=&gt; array($sub_cat_ids)</code> not works. please help    </p>
  
  <pre><code>&lt;?php
  $current_cat_id = get_cat_id( single_cat_title("",false) );
  $catlist = get_categories('hide_empty=0&amp;child_of='.$current_cat_id.'&amp;depth=10&amp;parent='.$current_cat_id );  
  $sub_cat_ids = "";
  foreach($catlist as $cat){
     $sub_cat_ids = $cat-&gt;cat_ID.",".$sub_cat_ids;
  }
  if(!empty($catlist)){ ?&gt;
      &lt;ul class="insight_style"&gt;
      &lt;?php
          $i=1;
          $args = array(
          'post_type' =&gt; 'post',
          'posts_per_page' =&gt; -1,
          'category__not_in'=&gt; array($sub_cat_ids),// not working
          'category__in' =&gt; $current_cat_id,
          'paged' =&gt; $paged
           );
          $page_query = new WP_Query($args); 
          if ( $page_query-&gt;have_posts() ) : while ($page_query-&gt;have_posts()) : $page_query-&gt;the_post(); 
  
              } ?&gt;            
              &lt;li&gt;
              // do some stuff
              &lt;/li&gt;
              &lt;?php  $i++; endwhile; endif; wp_reset_query(); ?&gt;
          &lt;/ul&gt;
      &lt;?php  } ?&gt;
  </code></pre>