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
Your code is setting the post title to an empty value
'post_title' => $_POST['acf']['field_5e0b90db10390']
Also, do not do this
This happens automatically for every post that is inserted, calling this yourself means that it will happen twice.
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!
© 2022 Advanced Custom Fields.