Hi
I am using this to create new custom posts.
http://www.advancedcustomfields.com/resources/using-acf_form-to-create-a-new-post/
I have 2 templates with different forms, and creating different custom posts.
The code below is from functions.php and it needs to be different depending on which form is sent.
// Create a new post
$post = array(
'post_status' => 'publish' ,
'post_title' => $_POST["acf"]['the_field_i_get_post_title_from'] ,
'post_type' => 'my custom post type' ,
);
I hope this makes sense, I am having a hard time explaining it.
Best regards
Sonny
Hi @sonnyside,
Thanks for the post.
In this use case it is recommended to call the acf_form() function from within each template to create different posts depending on the template.
Another workaround would be to create a new post_id for the post by hooking into the acf/save_post hook.
I hope this info helps.