Home › Forums › General Issues › Auto generate post_title with acf_form › Reply To: Auto generate post_title with acf_form
Pretty sure you can add the title to the new post like so:
<?php
acf_form(array(
'post_id' => 'new_post',
'post_title' => false,
'post_content' => false,
'new_post' => array(
'post_type' => 'tickets',
'post_status' => 'publish',
'post_title' => 'my title'
),
fields' => array('field_5ba8b0c6a5116', 'field_5ba8b08c96be1'),
);
?>
Seems nicer, but you don’t have access to the new post ID 🙁
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.