Support

Account

Home Forums Front-end Issues Front End Form changes slug to post id rather then post title Reply To: Front End Form changes slug to post id rather then post title

  • Where you once using an older version of ACF? 4 perhaps?

    This is incorrect

    
    'post_title' => $_POST['fields']['field_5e0b90db10390']
    

    $_POST['fields'] was used in ACF versions before 5. In ACF 5 or higher you need to use $_POST['acf']

    Your code is setting the post title to an empty value

    use this

    
    'post_title' => $_POST['acf']['field_5e0b90db10390']
    

    Also, do not do this

    
    do_action('acf/save_post', $post_id);
    

    This happens automatically for every post that is inserted, calling this yourself means that it will happen twice.