title: Get array value in $wp_query->posts var_dump
body: <p>I have the following code:</p>
  
  <pre><code>$posts = $wp_query-&gt;posts;
  foreach($posts as $post){
      var_dump($post);
  }
  </code></pre>
  
  <p>This will grab all the posts for the query that is being run and display all the posts information. The var_dump looks like this:</p>
  
  <pre><code>object(WP_Post)#84 (24) { 
      ["ID"]=&gt; int(1190) 
      ["post_author"]=&gt; string(1) "1" 
      ["post_date"]=&gt; string(19) "2016-10-20 14:17:55" 
      ["post_date_gmt"]=&gt; string(19) "2016-10-20 03:17:55" 
      ["post_content"]=&gt; string(0) "" 
      ["post_title"]=&gt; string(21) "Chilled water systems" 
      ["post_excerpt"]=&gt; string(0) "" 
      ["post_status"]=&gt; string(7) "publish" 
      ["comment_status"]=&gt; string(6) "closed" 
      ["ping_status"]=&gt; string(6) "closed" 
      ["post_password"]=&gt; string(0) "" 
      ["post_name"]=&gt; string(21) "chilled-water-systems" 
      ["to_ping"]=&gt; string(0) "" 
      ["pinged"]=&gt; string(0) "" 
      ["post_modified"]=&gt; string(19) "2016-10-21 11:23:49"
      ["post_modified_gmt"]=&gt; string(19) "2016-10-21 00:23:49" 
      ["post_content_filtered"]=&gt; string(0) "" 
      ["post_parent"]=&gt; int(1182) 
      ["guid"]=&gt; string(48) "http://siteurl.com" 
      ["menu_order"]=&gt; int(0) **
      ["post_type"]=&gt; string(4) "page"** 
      ["post_mime_type"]=&gt; string(0) "" 
      ["comment_count"]=&gt; string(1) "0" 
      ["filter"]=&gt; string(3) "raw" 
  }
  </code></pre>
  
  <p>I am wondering how can I get the post_type value from that var_dump. (text in bold) I have tried:</p>
  
  <pre><code>print_r($post['post_type']);
  print_r($post[0]['post_type']);
  </code></pre>