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.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.