
I need to create a custom fields in front by using that field i need to get values from guest and have to be stored in post as draft using acf_form(),
i saw this http://www.advancedcustomfields.com/resources/using-acf_form-to-create-a-new-post/
post, but this post does’nt gives me much explanation of how o pass custom field values inside $args, is there any way to create custom field at front end and get the values from front end and i have to create a post with the custom field values and i need to publish it
i need something like this
<?php
acf_form_head();
get_header();
the_post();
?>
<div id="page">
<div class="content">
<article class="ss-full-width">
<div id="content_box" >
<div id="content" class="hfeed">
<input type="text" name="hello"/>
<?php
$args = array(
'post_id' => 'new',
'post_title' => $_POST['title'],
'post_status' => 'draft',
'meta_query' => array(
array(// custom fields of mine
'key'=>'Event Name',
'value'=> $_POST['event_name']
))
);
acf_form( $args );
?>
</div>
</div>
</article>
<?php get_footer(); ?>
where this code have to post these custom values to this my_pre_save_post( $post_id ) function and should create post and kept in draft, whether is this is possible
Just guide me please!!!
Looks like you need to include the ‘new_post’ parameter.
The last example on this page should help: http://www.advancedcustomfields.com/resources/acf_form/