Home Forums General Issues Creating a Custom fields in Front End


Creating a Custom fields in Front End

  • 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

    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

    <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"/>
    			$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 ); 
    <?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:

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Creating a Custom fields in Front End’ is closed to new replies.