$new_post = array( 'post_title' => $title, 'post_content' => $description, 'post_category' => array($_POST['cat']), // Usable for custom taxonomies too 'tags_input' => array($tags), 'post_status' => 'publish', // Choose: publish, preview, future, draft, etc. 'post_type' => 'my_custom_type' ); wp_insert_post($new_post);
How can I get the post id? Is it automatically generated? How can I show it before the form is posted? I'm trying to create a frontend form where I show to the user the post id is going to be created. Like "Hey man, you're posting the article nr #
<?php echo $postID;?>".
Is there a way or I'm totally out of mind? Thanks in advance.