title: WP_Query in the init hook
body: <p>the next chunk of code give me an error. The init hook is fire to early to have acces to: array($post->ID). If I use the 'wp' hook, the 'var_dump($all_dash_for);' always return 'null'. </p>
  
  <p>I'm using this code for a plugin metabox in the admin area. When I'm editing a custom post type, I want to exclude the post id of the query. Any ideas? thx </p>
  
  <pre><code>function dash_for() {
  
  global $all_dash_for, $post;
  $all_dash_for = array();
  $args = array(
      'post_type' =&gt; 'sliding_panel',     
      'post__not_in' =&gt; array($post-&gt;ID)
  );
  
  // Query the posts:
  $panel_for_query = new WP_Query($args);
  
  
  while ($panel_for_query-&gt;have_posts()) : $panel_for_query-&gt;the_post();
  
      $dash_for = get_post_custom_values('_dash_for');
  
      if(!empty($dash_for)){
          array_push($all_dash_for, $dash_for[0]); 
      } 
  
  endwhile;    
  // Reset Post Data
  wp_reset_postdata();    
  
  if ( empty( $all_dash_for ) ) {
      array_push($all_dash_for, 'empty');     
  }
  
  
  var_dump($all_dash_for);
  
  }
  
  add_action( 'init', 'dash_for' );
  </code></pre>