you need to remove this code:
'html_before_fields' => '<input type="text" name="post_title" size="30" id="title" placeholder="Enter title here" autocomplete="off">',
you need to create a text custom field that you will assign to be your title. The code below assigns the custom field to be the post title:
$post = array( 'ID' => $post_id, 'post_type' => 'events', 'post_title' => $fields['new_title']['value'], 'post_status' => 'draft' );
please also include this code inside the function before the
// Continue save action. I completely forgot about it:
// Update the Post wp_update_post( $post );
edited my post above as well and added this code.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 21, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.