Home › Forums › Front-end Issues › How Update a post in front-end with acf (acf_form) › Reply To: How Update a post in front-end with acf (acf_form)
In the acf_form() call you need to provide the post ID of the post that needs to be edited.
if (some condition) {
// the if needs to detect if a post is being edited
// if it is then set $post_id to the post to be edited
$post_id = $post=>ID; // something like this
} else {
// otherwise this is a new post
$post_id = 'new_post';
}
acf_form(array(
'post_id' => $post_id,
'field_groups' => array( 19250 ),
'post_title' => false,
'updated_message' => __("Post updated", 'acf'),
'submit_value' => 'Send',
'return' => ''
));
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.