title: Wp_query not working in wordpress?
body: <p>Am newbie to wordpress i can't understand WP_Query in wordpress,am passing parameter post_status => 'public' means what happend in Wordpress,</p>
  
  <pre><code>select * from wp_posts where post_status ='public'
  </code></pre>
  
  <p>I want to write query and show details like above mysql_query.But below my wordpress coding its getting result post_status ='auto_craft',Am so confused why its showing that result but am pass the post_status ='public'</p>
  
  <p>Wordpress:</p>
  
  <pre><code>&lt;?php
              $args = array(
                  'posts_per_page' =&gt; -1,
                  'post_status' =&gt; 'public'
              );
              $post_query = null;
              $post_query = new WP_Query($args);
              var_dump($post_query-&gt;request);
  
  
  
              if ($post_query) {
  
                  while ($post_query-&gt;have_posts()) : $post_query-&gt;the_post();
                      echo "fdsfl;dslfgsss";
                      global $post;
                      echo $post-&gt;post_title;
  
  
  
                  endwhile;
                  wp_reset_query();
              }
              ?&gt;
  </code></pre>
  
  <p>What's wrong in my above coding? in my var_dump i got result like below,</p>
  
  <pre><code>"SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' ORDER BY wp_posts.post_date DESC " 
  </code></pre>
  
  <p>What is 1 = 1 ? not checking 'post_status' = 'public'</p>
  
  <p>My Customize coding:</p>
  
  <pre><code>$post_status = empty($postarr['post_status']) ? 'draft' : $postarr['post_status'];
  if ('attachment' === $post_type &amp;&amp; in_array($post_status, array('public'))) {
      $post_status = $postarr['post_status'];
  } elseif ('attachment' === $post_type &amp;&amp; in_array($post_status, array('private_soundcloud'))) {
      $post_status = 'private_soundcloud';
  } else {
      if ('attachment' === $post_type &amp;&amp; !in_array($post_status, array('inherit', 'private', 'trash'))) {
          $post_status = 'inherit';
      }
  }
  </code></pre>