title: wp_insert_post custom post type
body: <p>I'm inserting custom post type with following code:</p>
  
  <pre><code>if(isset($_POST['submit'])){
  
      $post_id = wp_insert_post( array(
                      'post_status' =&gt; 'publish',
                      'post_type' =&gt; 'custom_type',
                      'post_title' =&gt; 'Some post',
                      'post_content' =&gt; 'Lorem ipsum'
                  ) );
  
  }
  </code></pre>
  
  <p>and I'm getting error page with; Title: "WordPress failure notice" and text in page "Are you sure you want to do this?</p>
  
  <p>Please try again."</p>
  
  <p>But when I try to insert post_type: post then is everything ok.
  And everything is ok when i try to insert without isset;</p>
  
  <pre><code>$post_id = wp_insert_post( array(
                          'post_status' =&gt; 'publish',
                          'post_type' =&gt; 'custom_type',
                          'post_title' =&gt; 'Some post',
                          'post_content' =&gt; 'Lorem ipsum'
                      ) );
  </code></pre>
  
  <p>Anybody had same problem?</p>