simple wp_insert_post example

// Create post object
$my_post = array();
$my_post['post_title']    = 'My post';
$my_post['post_content']  = 'This is my post.';
$my_post['post_status']   = 'publish';
$my_post['post_author']   = 1;
$my_post['post_category'] = array(0);
// Insert the post into the database
wp_insert_post( $my_post );"

This works fine. You code is correct, but it is an problem in the form to send the $_POST data?
See on this post for feature informations

Leave a Comment