I have created a custom post type wrestling and created its corresponding custom fields using Advanced Custom Fields. Now, I wanted the users to fill this custom form on the front end, so that on submission, the data would get automatically updated in the custom post type in the dashboard. For this purpose, I created a custom page and assigned a custom template to it which contained the required form. There are four HTML form fields that the users are supposed to fill, named name, venue, main_event and fee respectively.
The custom form fields that I created using Advanced Custom Fields are named as promotion_name, venue, main_event_ and price respectively. Now, in order to fill the data entered by the users on the front end onto the custom post type fields at the dashboard, I tried using the wp_insert_post() function as follows:
$post_information = array(
'promotion_name' => $_POST['name'],
'venue' => $_POST['venue'],
'main_event_' => $_POST['main_event'],
'price' => $_POST['fee'],
'post_type' => 'wrestling',
);
wp_insert_post( $post_information );
However, after the user submits the form, a new entry (no_title) does appear in my custom post type, but the custom form fields are still empty (See images below:)
I'm sure this is because I'm not using the wp_insert_post() correctly for updating custom post types. I'd really appreciate some help here. Thanks.
PS: This is how I have defined my custom post type in functions.php:
<?php
function wrestling_show_type()
{
register_post_type('wrestling',
array('labels' => array('name' => 'Wrestling Shows', 'singular_name' => 'Wrestling Show'),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'wrestling')));
flush_rewrite_rules();
}
add_action('init', 'wrestling_show_type');
?>


