Support

Account

Home Forums General Issues Using acf_form – add post title… Reply To: Using acf_form – add post title…

  • 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.